The Source for Java Technology Collaboration
User: Password:



Start New Message Post a Reply

Subject:  I love closures, but...
Date:  2006-08-30 03:37:21
From:  archangel


I fell in love with closures in Ruby and Groovy, but I think adding them to Java isn't a good idea.

My issues are these:

  1. Why? What are the use cases for closures? These solve some problems, sure, but is it really so important that we need a major language change?


  2. Is someone going to go back and rewrite the collection APIs to take advantage of these? How about the Swing listener mechanism?



Personally, I would like to see the following poll added to java.net:

"Should Sun create a new statically-typed language rather than add new features to the Java language?"

My problem is that I think Java is getting harder and harder to learn and teach.

I would like to see a new statically-typed language with proper templating, closures and all the other things that people like from other languages with a single, unified approach. Like Groovy, as it's in the JVM it'll be able to interact very easily with existing Java code.

This means Java stays nice and stable and the wizzy features can be added to a new language - "Java 2" (the marketing people will love it!).

 Feed java.net RSS Feeds