Generics? More like Specifics.
By greimer on Feb 28, 2005
This is probably just me, but I was reading up on the J2SE 5.0 enhancements, and it struck me that the term "generics" seemed kind of backwards. Of course, the term probably trickled down from the (sometimes pedantic) world of high-level OO theory where things only have to make sense in an abstract sort of way, and in any case it has that don't screw with me, I'm a professional sound to it (like regular expressions), but if the feature lets me write this:
/\* gimme a string, dang it \*/ String foo = hash.get("bar");
...instead of this:
/\* gimme a string, and oh, by the way, make it a string \*/ String foo = (String) hash.get("bar");
...shouldn't they have called it "specifics"? It just seems to me that if you construct a Hashtable that returns a specific type rather than a generic type, then, well... hmm. Okay, so the feature rocks. Done talking now.