Friday, July 8, 2011

Java 7 Launch Event - An Initial Reaction

After watching the Java 7 Launch Event Webcast ... it all seems a little, well ... meh!



 Java 6 was released at the end of 2006, so what's new in Java 7, here are some highlights:

  • Some minor language improvements (Project Coin - JSR 334)
    • try-with-resources - A mechanism to automatically "close" resources when exiting a block, kind of like C# has had from day 1. 
    • Support for strings as switch statements selectors, kind of like C#.
    • Type inference in generic instantiation via the the diamond operator.
    • Binary literals and underscores in numeric literals.
    • "Multi-catch" of exceptions.
    • Improved varargs support.
  • I/O enhancements (JSR 203).
    • Further asynchronous IO developments.
    • A better file system API.
  • Concurrency and collections updates.
  • Some JVM improvements (JSR 292).
A complete list of features may be found here.

Most of the new language features seem like little more than syntactic sugar.  The try-with-resources mechanism looks to be the only new language feature with real value as it will eliminate bugs by making resource management less error prone.

InvokeDynamic is welcome also especially given the associated  promise of better optimization of non-Java languages  running on the VM.

In the round there seems to be little get excited about in Java 7.  There's just not a whole lot there especially given how long it has been since the release of Java 6.   

We are promised an "aggressive" release cycle for Java 8, a version which will be more "revolutionary" than the "evolutionary" Java 7 version.   

Highlights touted for Java 8 (or later) include:
Support for modularity, if done well, will be very welcome and have a tangibly positive influence on application/library structure, encapsulation and maintainability.

I am rarely enthusiastic about the introduction of new language features, especially where equivalent functionality is already available via a different syntax.  Direct language support for collections is just a convenience.   I won't complain so long as it is not implemented as a generic mechanism to overload operators (ala C++).   

Take a look at Java 7 and see what you think.

No comments:

Post a Comment