Java 5 Features Provoke Dissent

    September 1, 2006
    WebProNews Staff

The release of Java 5 was widely hailed by Sun and through the tech world, but one programmer sees evidence of ‘feature creep’ posing problems for Java coders.

Shai Almog has a list of Java 5 features that caused him to declare the changes made to the language are something of a failure.

In his blog post about the Java 5 language, Almog discussed features and the issues they can pose to the diligent programmer. He has received some pushback from posters at the JavaLobby forums over his assessment that features add complexity:

This complexity might be small but added up to the rest of the language features that you need to juggle in your mind and additional syntax you need to recognize… They all add some complexity.

He stated several points that drew criticism from other Java coders, going so far as to (humorously, we hope) call him a COBOL programmer. From Almog’s list:

  1. Generics – bad implementation that does not maintain type safety, exact same thing as a cast, odd syntax for polymorphism, introduced warnings instead of errors, redundant.

  2. Enums – Enums were denied from the original Java programming language because they are unnecessary and encourage bad code in many cases. There is one use case where Enum’s have an advantage over other object oriented solutions and that is in embedded systems where the class size matters.
  3. Static imports – breaks encapsulation and forces people to search in yet another place for every unidentified value within a class. No real purpose other than verbosity.
  4. New for loop – again syntax sugar for something that could be done for the regular loop.
  5. Autoboxing – a huge source for bugs and essentially hides what is happening under the hood. People might expect primitive speeds and be surprised when they get 20x times the speed with a plain array.

Annotations did find favor with Almog, who wrote, “Annotations are the only Java 5 feature to produce REAL value!”

Within the various responses to his post, Almog cited the reason for posting about these issues again:

I’m afraid that people assuming that Java 5 is a great success would want this carried on for every pet feature they want pushed into Java.

One person who disagreed pointed out that the changes in Java 5 have made the code cleaner, and that Java needs these changes to remain relevant to programmers. Another considered Almog’s points as straw-man arguments, stated as absolutes when they are actually grey areas in Java 5.


Add to | Digg | Yahoo! My Web | Furl

Bookmark WebProNews:

David Utter is a staff writer for WebProNews covering technology and business.