JSR-666: Elaborate Joke or Profound Statement?
Monday, March 31st, 2008 by Enrico
We just recently caught wind of some proposed “extensions” to Java under JSR-666. One of them in particular had us all laughing and that was the yoda keyword. Here’s example code showing how this new keyword would be used:
yoda (UnsupportedEncodingException) {
String s = new String(byteArray, "UTF-8");
}
I didn’t quite get it until I read this post. The purpose of the yoda keyword is to tell Java to “do or do not” when there is no corresponding try.
Another gem from JSR-666 is a new exception of type undetermined until it is first accessed, appropriately named a SchrödingerException (the umlaut is required, by the way). Even more silly extensions seem to be converging under JSR-666 just in time for April.
Still, at least one of these, the yoda keyword, is actually semi-inspired by a Ruby idiom and there is a serious standing proposal to add closures to Java in an upcoming version (7, perhaps?). Java 5 saw the introduction of generics as well. All of this makes me think that maybe the proposed JSR-666 extensions are some kind of profound statement about the danger of trying to constantly add hot new features from other up-and-coming languages (like Ruby) to Java. I found generics to be a very welcome addition to the Java language but there were some hiccups in the implementation, especially where backwards compatibility with “raw” (un-templated) types was involved.
What do you think? Are these funny extensions just an elaborate joke or are they a profound statement about the current state of Java as a programming language?
Tags: April Fools, Java/J2EE, Programming, Sun




April 18th, 2008 at 10:43 am
Do you consider closures to be a “hot new feature”? I don’t tend to think of language features from the 1930’s, 1960’s, or 1970’s as “hot new”.
April 18th, 2008 at 10:58 am
By “hot new features,” I meant features that have very recently become popular even if they’re not actually new. Of course, closures have existed since way back but it seems like the blogosphere only recently went crazy about them and around that time there was news of a proposal to add them to Java. Admittedly, it was a mistake to say “hot new features” when “hot features” would have worked just fine and would not have caused a misunderstanding. Even worse, I realize that the wording might even suggest that I think closures came from Ruby! I really need to edit my writing a lot more carefully…
But thank you very much for reading! =)