Skip to main content

What do you think about closures in JDK 7?

Closures will improve Java
51% (185 votes)
I was/am opposed to closures in Java
12% (44 votes)
Where was the community process in this decision?
14% (51 votes)
I don't know
9% (32 votes)
What's a closure?
13% (46 votes)
Other
2% (8 votes)
Total votes: 366

Comments

Don't care

I don't think it really matters either way. I think it'll make the syntax clearer but I view it primarily as syntactic sugar and don't feel strongly for or against it.

Some people are up and arms about this issue. But I don't think it'll be as bad as generics or annotations which are prone to abuse.

The only thing that worries me is this "keep up with the Joneses attitude" that if language X has it Java must have it too. I like Java, I still think it is a great language and is better than many alternatives (including C# and Scala). But Java shouldn't be dynamically typed or have automatic type inference (like OCaml) or have some of the weirder features other languages have.

Cautiously optimistic

I'm cautiously optimistic about the impact closures will have on Java. I'm not terribly familiar with them from other languages, but options are generally good, and like what I've seen of them in Groovy. Exactly how much resemblance they'll bear to each other... well, I guess we'll see?

But I'm a little concerned about the community process in this decision... I haven't seen the actual announcement (is that visible online anywhere? Or at the least the actual wording?), but it sounds like the announcement was "There will be closures in JDK 7". Not "Well, we've decided to push back the JDK 7 release for reasons that have nothing to do with the Sun/Oracle Deal, and now have time to revisit the closure proposals", not "Project leadership has changed, and we're interested in revisiting closures", but "Closures are coming. Our closures. Applaud. Now".

Maybe I've got the wrong end of the stick on that, but it's not exactly the impression I'm getting. And that is a little concerning. I like the fact that Java is open. I like that there's the JCP proposals, that anyone can contribute. I haven't, but then I've only just started getting into the complete Java Ecosystem. And up until now I've liked what I've been seeing. This, in particular, has gotten me a little worried.

Still, I'm going to give Sun the benefit of the doubt for now, especially given that I don't have nearly enough information to make an informed decision on this (not that that's ever stopped anyone...), but initial impressions are not exactly positive.