Snif sniff, all these syntax sugar sucks!
I want Smalltalk!! ... sadly Java is so popular that I have to work with it :-(
The need for generics is a myth, from C++.
With today's method dispatching techniques -- like inline cache-- (researched by Sun in the Self Language) there is not really a real performance gain with generics, and static type checking.
In fact static type checking bothers in a OO lang... one example: the need of javabeans that makes extensive use of reflection.
I think that static type checking must be optional (like in StrongTalk... again another researh language of Sun)
And the use of Iterators makes poor encapsulation of container objects.
I like the Smalltalk collection aproach, with "code blocks", for example to call the "print" method in each element you can do:
Generics arent all good because of any potential speed increase.
They are all good because they enforce homogeneous collections - and provide errors at compile time instead of run time. Doing run time checking to enforce homogeneity is clumsy.
I consider them to be like exceptions, a real bonus to increasing readability.
Really, folks, the issue is about the Java 1.5
syntax proposal -- all this stuff about what
your favorite language is or what else you think
should be done to Java is juvenile, egocentric,
and rude to the author. There are a thousand
forums where you can post your thoughts on
those subjects.
The variance syntax looks clearly superior.
The type syntax looks nice, as long as the
parser can handle it, but I doubt that you
could ever convince Sun to switch from the
angle bracket syntax used in C++, Pizza, etc.
The eachof syntax is rather problematic,
looking like an operator rather than a control
structure. It makes plenty of sense in a
language that has full-on iterators, like CLU or
Ruby, but for Java it's out of place. Which to
me is an argument for leaving the foreach
operator out of Java 1.5 altogether, and coming
up with a proposal for a proper iterator syntax.
The foreach operator is non-orthogonal wart that
violates basic language design principles.
They are all good because they enforce homogeneous collections - and provide errors at compile time instead of run time. Doing run time checking to enforce homogeneity is clumsy.
I consider them to be like exceptions, a real bonus to increasing readability.