Er...[if you have the misfortune of being paid to work in Java] they remove a pile of type-casting cruft and make code more useful to large and/or transient teams.<p>The author conveniently glosses over the type-casting from pre-generics Java and instead compares to Ruby. Duh...of course Ruby is a cleaner read. But compare learning a new API:<p><pre><code> // pretty evil
List<Thing> getTheThings();
// really evil
List getTheThings();
</code></pre>
Or iteration:<p><pre><code> // pretty evil
for (Thing t: getTheThings()) {...}
// kill me now
for (Iterator it = getTheThings().iterator(); it.hasNext()) {
Thing t = (Thing) it.next();
...
}</code></pre>
They provide more type safety and not syntactic sugar. One cannot have complete type safety at runtime using type casts; if he thinks he can, he needs to take a simple programming course again.<p>If the OP wanted readability, he could use iterators. It's amazingly clear:<p><pre><code> private void printCollection(Collection c) {
Iterator<String> i = c.iterator();
while(i.hasNext()) {
System.out.println("Item: "+i.next());
}
}</code></pre>
There's just no real alternative to generics in Java. It's either that, casting (terminally insecure) or a more modern type system, which would be a huuuge change for the language (and in which case, you might as well use Scala).<p>If you want to complain about things that make code harder to understand, I wonder why the author doesn't rant about annotations.