erasure? (say as opposed to the way they're done in C#),
Point taken I guess. No erasure would have horribly broken Java 1.4 code
and previous, so it is necessary. Still, it is a flaw.
While there are definitely times when having generics information at
run time would help, the fact that it's compile-time only does benefit
in that it forces one to handle type issues at compile time, when bugs
are much cheaper to fix than at run time. In practice, the need for
run-time generification is only for corner cases; most of the time
it's completely sufficient to have only compile-time checking.
People misunderstand the generics mechanism. Generics support type
analysis, and type analysis can be quite tricky. Hence, use of
generics can be tricky. However, once you get all the generics
compiler messages ironed out, you have a self-documented ironclad type
contract in your code. It's well worth the effort.
It's just like the broken Java equals() concept: it "works" only
as long as you're doing procedural programming.
It's not the first time you criticized Java Object.equals(), and you've
And probably not the last.
been asked for clarifications, but I didn't see them. I still fail to
understand how not OO or how anti-OO that is.
He's just being trollish. Making inflammatory comments without
evidence or logic is one of those classic trollish Usenet behaviors.
Others have responded to his criticism that Java is not object-
oriented, which, of course, it is, and "charlesbos73" was equally
silent regarding their responses. At any rate, I haven't seen anyone
respond to any of his responses. For example, his misrepresentation
of statements from /Effective Java/ was called to account.
Polymorphism is one of Grady Booch's six pillars of object orientation
- by that standard 'Object.equals()' definitely fits the O-O paradigm.
I see no way in which Java violates object orientation except perhaps
the support for static members. Java is clearly an object-oriented
language. (OK, Smalltalk fans, settle down.)