Hacker News new | ask | show | jobs
by willtim 3122 days ago
The "wait and see" approach as you call it, means that "Generics" (a.k.a. parametric polymorphism) have had to be retro-fitted to languages like Java. This means they are more complex than they need to be and have some ugly edge cases.
2 comments

This. We still can't overload foo(List<Integer> x) and foo(List<String> x) because vintage 2004 JVMs wouldn't be able to distinguish them. Type erasure was a horrible compromise from which Java will probably never completely recover.
In C11 they are even uglier with the _Generic selector, which understandably was made to work together with how generics were done via pre-processor macros.