• Post Reply Bookmark Topic Watch Topic
  • New Topic

No Closures for JDK 7?  RSS feed

 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

Why no closures for JDK 7?
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may find this Java 7 "status" page helpful: http://tech.puredanger.com/java7. It has links to all the relevant discussions.
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had a look at it, but I want to know why closures are omitted for jdk 7?
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assuming that you've already read all those posts that describe the pros and cons of the various proposals (have you?), you may have to wait for someone from the JCP Java 7 expert group to make a definite statement.
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16057
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Probably because there are several different proposals for closures in Java, and whoever is in charge can't decide which one to include in Java.

Adding such a language feature is not something that should be done without thinking, because once it's in the language, it's impossible to change and it will be there forever.
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Accepted. But heard that C# 3.0 has closures in it as part of its specification. Just wondering how long would it take for Java for getting it in as part of the JLS 7. By the way, yet another cool feature that I found was the improved catch block. What a cool idea....
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just because some other language acquires a feature doesn't mean that it's a good idea to add it to Java as well. I for one hope that it won't happen. If you read through all the discussions you'll see that each of the various proposals has significant drawbacks.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I second Ulf's comment - a sure way to reduce the usability of a language is to clog it up with everybody's favorite gimmick. I even consider generics a cosmic pain!

There is a cycle in computer languages - starting with a clean yet powerful design which programmers rejoice in, gradually it accumulates cruft and fat, people start looking around for a cleaner language - repeat.

Bill
 
John de Michele
Rancher
Posts: 600
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jothi,

If you're really looking for closures in your Java, you should take a look at the Groovy language.

John.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!