Monday, August 21, 2006

Closures in Java: Is it too late?

So the interesting news broke that their is finally a proposal for closures in Java. My immediate feeling? Well for one the verbosity of the syntax proposal concerns me deeply, it is one of those things that unless it was thought of from the start will always be a problem to retrofit back into the language. The implications here is that we have a less than ideal proposal for the syntax when you compare it to say, Groovy's or Ruby's equivalent.

Is it too late now? My feeling is yes, Java has been around for a decade now. It has jumped several iterations to Java 5 (with Java 6 coming shortly) and the APIs have progressed hugely. The implications of adding closures would be huge, you would have to go back and revisit ALL the Java APIs. I mean, if closures had been around since the beginning the collections API would be entirely different. As would other things like the way we deal with transactions and file I/O.

Don't get me wrong I think it is great that they are considering it, even if it is a decade too late, but it will take a long time for the real effects to be felt until the APIs are made closure-aware.


Anonymous said...

I am so happy to get some Archlord gold and the Archlord money is given by my close friend who tells me that the archlord online Gold is the basis to enter into the game. Therefore, I should buy Archlord gold with the spare money and I gain some cheap Archlord gold from other players.

Anonymous said...

Many years ago, I already know the silkroad online game, but at that time I do not play, Recently due to my friends introduce, I began to play the game, but I need the silkroad gold, my friend look me the first time to play so send me some sro gold, but I still need more silkroad online gold, so I want to buy.