Skip to main content

Monkey Wrench

Posted by editor on February 6, 2008 at 6:33 AM PST

"Puzzling" features considered harmful?

It may be a first: a puzzler on a feature that hasn't even been approved for inclusion in the Java language yet. Of course, it helps that the source of this puzzler is Neal Gafter, co-author of both Java Puzzlers and the so-called BGGA Closures proposal, Gafter being one of the two "G"s (James Gosling is the other).

In Closures Puzzler: Neapolitan Ice Cream, he writes,

This puzzle explores the question of whether people experiencing
the same thing through different senses are really experiencing
the same thing at all. What is the program's output, and why?

This puzzle uses Java
, so if you want to try it you should download the
prototype href="">here. You can
download the puzzle sources href="">here.

Without getting too deeply into the specifics of the puzzler and why it involves enums, there very idea that closures are already fertile ground for puzzlers, i.e., non-intuitive behavior, strikes some as a code smell (a phenomenon that Neal makes an oblique reference to earlier in his blog). Kirill Grouchnikov confronts this issue head-on in his blog, And so it begins - the first closures puzzler.

Neal Gafter has posted the first closures puzzler. I guess the second edition of Java Puzzlers is in works, and closures will be a hefty addition to the book. If anything, this makes me really sad.

Saying that the kinds of weird side-effects and unintuitive overloads typified by the book's various puzzlers are atypical of the real-world Java code he works with, Kirill goes for the money quote:

I would even go as far as to say that a feature implemented in a way that results in at least one puzzler is not a feature worth having in the language.

Check out the comments on the blog for the debate between Neal and Kirill. I imagine that for every programmer who thinks Kirill's dismissing closures and their necessary details too quickly, someone else is probably saying "why weren't we thinking this way before the generics fiasco?"

Debate ahoy. Enjoy.

Also in Java Today,

Geertjan Wielenga continues a NetBeans tutorial series on JavaLobby with the brief tutorial, How to Add Resize Functionality to Visual Applications in Java? Picking up from a previous article that showed how to use the IconNodeWidget class, he shows how to create resize borders that activate when hovered over, and which can be used to resize the icons, including their respective images.

Eduardo Pelegri-Llopart notes GlassFish and NetBeans support for Grails 1.0 in an entry on The Aquarium: "Good news for
Grails fans:
Grails 1.0 is
Now Available
and its adoption seems to be increasing:
is already in the list of
Grails Supported Platforms,
and others are going to continue to improve on that.
On the tools side,
Martin and
report on early Grails support
NetBeans 6.1 M1
(but some growing pains still)
and we had already reported on
Grails and Hudson."

Billy Newport takes a look at
Characteristics of DataGrids in today's Weblogs. "This describes the various characteristics of DataGrids in terms of features and how they work. It should help people understand what this new technology does."

Happy Brithday Project Grizzly! Jean-Francois Arcand writes,
"one year has passed since we started the Grizzly Project by its own...from zero, we have now a strong community of users, customers and an healthy Grizzly that doesn't seems to want to hibernate!"

Notice: The download server,, went down Monday morning 4 Feb. 2008. It has since been restored but some files are currently missing. Downloads from that server should not be considered current. The frong page message will be updated when full restoration is complete.

Today's Forums begin with a post from rah003 on SwingX's
Next Release.
"We are about to prepare next release - 0.9.2 towards the end of February/ beginning of March so if there is anything that you would really like to see fixed, vote for it today. Or even better - provide a patch as an attachment to the issue. Just remember that for any contributions bigger then 20 lines you need to sign JCA/SCA so we can include those contributions in the code."

billg would like to get the
Source for the effects demo.
"I didn't know if it was possible, but I'd love to see the source for the new effects demo: . It's a great demo, and it would be useful to see the code behind it if possible."

lpolycarpou wonders
How does WS-Reliability ensure messages are not lost in metro?
"Using WS-Reliability for a web service in NetBeans seems to just be a case of turning on a checkbox for the web service. But how is this actually handled by metro? How are SOAP messages over HTTP made reliable? I would expect that for a reliable solution, the client needs to know how to manage broken HTTP pipes / timeouts and redeliver any WS requests. If the HTTP response is not received by the client, how does the client know whether the message was actually received by the WS or not? One implementation could be for the web service to actually maintain state of these requests and save the results of duplicate requests for specific clients so that they are not replayed."

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.

"Puzzling" features considered harmful?


Wow! Isn't is a smart business model? 1)Start with a small booklet on puzzlers for language X. 2)Shove a "sophisticated" feature into that language. 3)Include the feature in the next edition (the size of encyclopedia britannica) and you have an assured income for a life time (or until developers abandon that language)! [ Of course, to hell with the developers who will spend the rest of their sorry lives figuring out the puzzlers and trying to make a living building software in that scary language. ]