Skip to main content

The State I'm In

Posted by editor on February 20, 2008 at 7:14 AM PST

The closures debate and the bigger picture

Your editor is back in Atlanta, after a four-day trip to Grand Rapids, MI (and yes, it was cold and snowy... that's what winter's supposed to be like), and catching up on things here after being online only enough to get the front pages up Monday and Tuesday.

Looking at what's been going on, the thing that stands out is the current poll. Not just the results, but the participation, and the side effects. I always knew that sooner or later we'd want to get a sense of how the various closure proposals were doing, and that it would be a poll that got a lot of votes. After being up for just five days, 1300 people have voted, making it far and away the most active poll we've run in a while.

Perhaps more important is that along with discussing the major proposals and their merits, a few people are asking the meta-questions where are we going with all of this, and whose choice is it to make anyways?

We feature two prominent blogs on this topic on the front page today, starting with Stephen Colebourne, co-author of the "First Class Methods" (FCM) closure proposal, who has posted a blog Evaluating BGGA closures. He notes his obvious bias and starts off asking a pair of bigger questions. "The closures debate is really a touchstone for two other, much broader, debates. The first "what is the vision for Java". There has been no single guiding vision for Java through its life, unlike other languages." He contrasts this with the effective "ownership" of other languages by individuals, like C# (Anders Hejlsberg), Perl (Larry Wall), Python (Guido van Rossum), C++ (Bjarne Stroustrup), and Ruby (Yukihiro Matsumoto).

The impact of this lack of guiding vision is a sense that Java could be changed in any way. We really need some rules and a guiding Java architect.

The second touchstone debate is "can any language changes now be successfully implemented in Java". This is generally a reference to generics, where erasure and wildcards have often produced havoc. In the votes at Javapolis, 'improving generics' got the highest vote by far.

The result of implementing generics with erasure and wildcards has been a loss of confidence in Java language change. Many now oppose any and all change, however simple and isolated. This is unfortunate, and we must ensure that the next batch of language changes work without issues.

Despite this broader debates that surround closures, we must focus on the merits of the individual proposals.

Stephen links to a similarly-concerned blog by Ted Neward, who wonders Who herds the cats?

Unfortunately, the two most recognized "benevolent dictators" of the Java language, Neal Gafter and Joshua Bloch, are on opposing sides of the aisle on this. Each has put forth a competing proposal for how the Java language should evolve. Each has his good reasons for how he wants to implement closures in Java. Each has his impressive list of names supporting him. It's Clinton and Obama, Java Edition. The fact is, though, that when these two disagreed on how to move forward, lots of Java developers found themselves in the uncomfortable position faced by the children when the parents fight: do you take sides? Do you try to make peace between them? Or do you just go hide your head under a pillow until the yelling stops?

This is the real danger facing Java right now: there is no one with enough moral capital and credibility in the Java space to make this call. We can take polls and votes and strawman proposals until the cows come home, but language design by committee has generally not worked well in the past. If someone without that authority ends up making the decision, it will alienate half the Java community regardless of which way the decision goes. The split is too even to expect one to come out as the obvious front-runner. And expecting a JSR committee process to somehow resolve the differences between these four proposals into a single direction forward is asking a lot.

So what do you think? Does Java need a "benevolent dictator"? Has design-by-committee led to a fear of change? Will we have neither closures in Java 7, nor something as seemingly simple as switch-on-String? And if Java does need someone to make the call, who is it, and do they have the clout to make a decision stick?

Also in Java Today, a NetBeans wiki page offers a complete, step-by-step introduction to creating Mozilla application addons with NetBeans. "You can easily setup NetBeans to create Firefox Addons for the following: Mozilla Firefox, Mozilla Thunderbird, Mozilla Suite 1.x, Netscape, SeaMonkey, Flock, Sunbird , and Nvu. This can be achieved using the foxbeans module for NetBeans available at the NetBeans Plugin Portal website."

In today's Weblogs, Kirill Grouchnikov announces the

Flamingo 3.0 official release. "The official release for version 3.0 of Flamingo component suite, including command buttons, breadcrumb bar, ribbon and file viewer panel."

Jayson Falkner offers the
Lazy coder's mapping of DNS prefix to a sub-directory in a web application.
"The Servlet specification provides a really elegant mechanism for packaging up a whole website in to a single WAR file and deploying that file as a website. Multiple websites can be mapped to different domain name prefixes, such as '' versus ''. This blog explains a hack to map the domain prefix to a sub directory of the same web application."

And in the latest installment of his tips series, Arun Gupta presents
TOTD #28: Getting Started with Rails 2.0 Scaffold.
"Rails 2.0 changes the way Scaffold works. This blog walks you through the steps to create a simple CRUD application using Scaffold in Rails 2.0."

In today's Forums,
kirsche40 explains the how and why of interrupting threads in
Re: Thread Problem.
"You are not the first and will definetively not the last user who will become angry about thread handling in Java. This is because of a missing advanced implementation for threads and the lack of documentation. Currently the only way to stop a thread is Thread.interrupt(). You have to implement a try-catch which encapsulates the whole thread code."

lumenlunae reports problems with
Custom Tab Components on a Mac.
"I am working on a project for university, and want to add close icons to tabs in a JTabbedPane. To this end I have checked out the TabComponentsDemo from the Java Tutorials page (here). The code there works fine on a PC. However, on every Mac we ran this demo on, it doesn't display the close buttons. (Running Mac OSX 10.4.11 and Java 1.6.0 (b88-17-release). We've not been able to find another version of Java 1.6 for Mac 10.4.) Does anyone have an idea if there is a way to fix this, or is it an issue with this (beta) version of 1.6?"

Finally, sandykhan has hit some problems with
supporting hardware floating point unit.
"I am building cldc for a target which has a floating point co-processor. So, my intention is to utilize that co-processor to perform floating point operations. That's why, I have set ENABLE_SOFT_FLOAT=false while building cldc. When I run that vm on target platform, some floating point operations throw exceptions and some give wrong results. After that, I tried to build by setting ENABLE_SOFT_FLOAT=false and ENABLE_ARM_VFP=true, but now some errors are appearing during build process."

Current and upcoming Java

Registered users can submit event listings for the href=""> Events Page using our href="">events submission form.
All submissions go through an editorial review before being posted to the

Archives and Subscriptions: This blog is delivered weekdays as
the Java
Today RSS feed
. Also, once this page is no longer featured as the
front page of it will be
archived along with other past issues in the href=""> Archive.

The closures debate and the bigger picture