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.
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.
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).
Thanks Daz! I’ll definitely have to check it out.
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”.
You’re confusing two different meanings of the word generic. Chill out… it’s perfectly fine for the same word to mean different things.
If only I could be a big man and insult Pat’s valid opinion without leaving my name.
settle down boys! we’re all adults here.