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.

Comments

  1. Anonymous
    November 10th, 2004 | 12:07 am

    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. November 10th, 2004 | 7:32 am

    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. Darrell DeBoer
    November 10th, 2004 | 8:21 am

    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. November 10th, 2004 | 8:54 am

    Thanks Daz! I’ll definitely have to check it out.

  5. Anonymous
    November 10th, 2004 | 7:28 pm

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

  6. Anonymous
    November 11th, 2004 | 9:30 am

    If only I could be a big man and insult Pat’s valid opinion without leaving my name.

  7. November 11th, 2004 | 5:00 pm

    settle down boys! we’re all adults here.

Leave a reply