Here's a nice overview of new language features coming in JDK 7. Good stuff but nothing most other popular languages haven't had for years. Add type inference and you could have:
ages = {"Arthur" : 42};
ArthursAge = ages["Arthur"];
with type safety intact. Kinda looks like Javascript doesn't it? It's valid python too (sans semicolons). But it could have all the static type goodness of Java with that syntax. Other languages do it.
In addition to the features in that post, a couple of weeks ago Mark Reinhold announced that closures will also be included in JDK 7. After all the wars over closures in Java two years ago and three proposals that went nowhere, this was a big surprise. It turns out that closures are being added to prevent some particularly nasty syntax that would be required for using parallel arrays. Java's ceremonial boilerplate syntax is forcing it to adapt some features that are common in most other popular languages. It's welcome, but too little, too late for some folks. Others would rather that Java not evolve much. Relative stability has served Java well.
Other languages on the JVM already have the features that will be in Java 7 and likely Java 8 and Java 9 too. You could just get on with those if you need those features. That has been my approach, when possible, but at least I know that Java will be moving forward, albeit slowly, when I do have to use it.
JDK 7 has also slipped to later in 2010 so don't expect to be using this stuff in your projects until 2011.
I really like the new features. A function type in Java...never thought I'd see the day.
Comments