Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What do you actually need generics for that you can't do with interfaces? Not to mention that compile-time generics (read: generating code for each type) make testing with mock types much, much harder.


Type safety and performance.

Also, how does it make testing harder?


Not everything could be type safe with generics.

You can't typecheck the generic itself. Especially conversions could be really hard with them.

(I love generics, still this somewhat aweful). Currently Converting Generics between Scala and Java is totally Ugly.


Could you provide an example? I'd be interested to know more.




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

Search: