Generics Misnomer

Why did the latest JDK have to go and copy C# and name their language feature Generics when it looks like this:

List<string> notSoGenericListOfStrings = getInitialListOfStrings();

I hope it’s not just because the implementation happens to lose all of that compile time information, making each strongly typed element the lovely generic java.lang.Object. After reading the reasoning behind its implementation and appreciating some of its motivators, I’m sure it will be all the more be interesting resolving any Reflection or AOP bugs in the future.

7 Replies to “Generics Misnomer”

  1. Perhaps it’s because “Generics” is already a widely used term, and has been for a long time. That you’ve not heard of it is not Sun’s fault.

  2. I thought that this post might stir up a few comments. I also know that this term has been widely used well before it was submitted as a JSR (I really liked the feature when C# introduced it), but I still don’t think it’s a good idea to call something by a bad name just because it’s known for it (in my humble opinion).

  3. If you’re interested in the intricacies/anomolies of Java Generics, Bruce Eckel has written a great set of articles about generics and the concept of “erasure”.

  4. You’re confusing two different meanings of the word generic. Chill out… it’s perfectly fine for the same word to mean different things.

Comments are closed.