In an interview with the Java Posse guys, Martin Odersky had a great answer to the question, “Should Java get closures?” Paraphrased, his answer was that it is like giving an elephant wings, it sounds like a great idea but what is the purpose. After I finished laughing and got back on the road from the near collision, I realized that he had just put into words what I have been feeling for a while. It seems that there has been a lot of talk about the syntactic sugar that can be added to the language, but is that the answer?
I really would love to see closures added to Java (along with several other big changes), but not just as a smattering of sugar. If you are going to add features to a language make them first order citizens or don’t do it at all. There is quite a bit that we can glean from other languages such as Ruby and Groovy. They have done some things very well and we should learn from other people’s successes.
Let me change the original question around a bit, should the Java programming language get an overhaul or should it be left alone?





Some would claim that Ruby sort of *is* the overhaul of Java…at least for web development. Maybe Groovy is a better case for the “new Java”.
A new language similar to Java (in the way that Java was similar to C) could be a good thing. The problem is (as I see it) that Java started out intended for something entirely different than how we use it now, and every step of the way new features and API’s were glommed on, and it is now as much a general purpose language as COBOL used to be, or C. It’s rare that something that does everything pretty well does any one thing exceptionally well.
I would MUCH rather see domain specific languages (or “subdomain” specific languages) that are built from the ground up to implement solutions in a specific space. These languages could all compile or be interpreted down to bytecode and run on a JVM.
What I think would be cool would be a DSL for web work, another DSL for ORM, another DSL for fat clients, etc., and an integration DSL. Each separate concern could be coded in modules using a language *made* for that task, and pulled together using a language designed for pulling things together.
Boy am I nuts.