Updated below…
A scant few days ago I started throwing WBJUS around, and tonight, Small Language Changes for JDK7 appears. What timing!
- Strings in Switch? WBJUS!
- Automated Resource Blocks? WBJUS! (just a library too!)
- Block expressions? WBJUS!
- Exception handling improvements? Actually the Scala version of this is a bit ugly: catch e @ (_: IOException | _: RuntimeException ) => handleIt…
- Improved Type Inference? Are they even trying? A most emphatic WBJUS!
- A new syntax for wildcard variance? If you’re going to stay with use-site variance instead of definition-site variance, why bother changing the syntax? Deck chairs, etc. WBJUS!
Don’t get me wrong: I have the utmost respect for Sun’s stewardship of the bottom two-thirds of the Java ecosystem. The Java VM spec, Memory Model, HotSpot and significant chunks of the Java runtime library are world-class.
But Java-the-language? Scala, C#, Clojure, Haskell and every other language whose designers and managers are not cringingly risk-averse are beating it up and stealing its lunch money every damned day, and instead of fighting back, Sun is shopping for big dark glasses to hide the bruises.
Update: This article was posted to dzone where some additional discussion has taken place.
- Saturday February 28, 2009
- 6 Comments
- Previous Article
- Next Article
1 · Talden · Thu Mar 5, 01:56 pm
Sorry, for big projects switching languages (or even getting approval to incorporate a language for a component) is a major deal.
Taking advantage of minor improvements on the other hand is something the project and members can benefit from more easily.
That said these are fairly limited improvements. #5 we’ll use all the time, #2 less so and #1/#3/#4 very infrequently. #6 doesn’t interest or offend me.
Java6u14 looks interesting for performance improvements. Java7 looks interesting for NIO, annotation enhancements and maybe date/calendar replacement – That’s a little sparse in the way of advancement for java for what is likely to be the next 5 years (based on when projects might actually be able to start using a hypothetical Java8).
I imagine by that stage a more appropriate Java successor might be emerging from the groovy/scala/clojure family of ‘JVM but not Java’ languages.
2 · Alex Cruise · Fri Mar 6, 01:15 pm
Hi Talden,
Thanks for your comment. To be sure, my campaign is partly tongue-in-cheek. I’m not advocating that anyone throw away their Java source code and rewrite everything in Scala just yet—although some people are!
My intent is mainly to show that despite the sad lack of innovation in Java-the-language over the last few years, rather than wring our hands, complain, and contemplate more drastic language changes (and make no mistake, a great many people have already finished their contemplation and made the switch!) we can use a language that leverages our existing investments in platforms, libraries and tooling, provides huge benefits in abstraction and productivity, and best of all, already exists.
3 · stanasic · Sun Mar 8, 12:44 am
Hi Alex,
Thanks for taking the time to respond to my post at DZone regarding this blog post. As you might have gathered, I maintain that there are not enough “real-world” examples of usefulness of Scala, or for that matter, any other of the new JVM languages.
I am genuinely interested in advancement of Java language/platform, so I would appreciate any links and pointers towards (open-source) applications, whether Web or desktop, where Scala is used prominently. I searched on Sourceforge and Google Code, but I can’t find anything of interest.
4 · Alex Cruise · Sun Mar 8, 05:53 am
stanasic, thanks for the reminder. I’ll try to cook up a blog post with a roundup of real-world Scala examples soon.
5 · Larry Singer · Mon Mar 9, 08:13 pm
While Scala looks great is is only at V0.9.5 .
6 · Alex Cruise · Tue Mar 10, 07:40 am
Larry, that’s v0.9.5 of ScalaTest, a testing framework. There are a few other testing frameworks, Specs being probably the most popular.
Scala itself is at v2.7.3.