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