Hacker News new | past | comments | ask | show | jobs | submit login

Personally, I find this boilerplate equivalent to the comments one has to write documenting the requirements of the type, with the added benefit of readable error messages when you pass the wrong type. In other words, I find:

  // T here is a type that must support these two operations:
  //   bool froznit();
  //   void frobnob(Foo* foo);
  template <class T> class Frozner { ... }
And

  public interface SomeStupidName {
    public bool froznit();
    public void frobnob(Foo foo);
  }
  public class Frozner<? extends SomeStupidName> { ... }
To be just as much work to type.



Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: