The Artima Developer Community
Sponsored Link

Java Buzz Forum
And so it goes, around again.

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Charles Miller

Posts: 1014
Nickname: carlfish
Registered: Feb, 2003

Charles Miller is a Java nerd with a weblog
And so it goes, around again. Posted: Sep 1, 2009 10:46 PM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Charles Miller.
Original Post: And so it goes, around again.
Feed Title: The Fishbowl
Feed URL: https://fishbowl.pastiche.org/atom.xml
Feed Description: tail -f /dev/mind > blog
Latest Java Buzz Posts
Latest Java Buzz Posts by Charles Miller
Latest Posts From The Fishbowl

Advertisement

Back in 2002, I wrote the following about the proposal for an ‘enhanced for loop’ in Java 1.5.

Foreach takes probably the most common use of Smalltalk blocks, the internal iterator, and creates a syntactic special-case for them. Once again, it's a band-aid solution. Foreach removes the annoying duplicated syntax for the simplest case, but it does nothing to give programmers the chance to remove duplication on the more complex cases.

So it seems now for Java 7, closures having been dropped from the roadmap, it's time to apply the next band-aid. This time the recipient is the next in the line of usual suspects, resource management:

Absent a language change, you must close resources manually. That is why Java’s competitors have automatic resource management constructs (C# has using blocks and C++ has destructors).

Back to me from seven years ago:

Once foreach is implemented, the precedent has been set: whenever the lack of [closures] causes us to lag behind C#, don't fix the underlying problem, work around it with a variant on what we have already.

The funniest part, of course, is that C# 3.0 has had closures (or at least succinct lambda expressions with type inference) since 2007.

Read: And so it goes, around again.

Topic: EGoM fixes reserve price of 3G spectrum, WiMax Previous Topic   Next Topic Topic: Snow Leopard: Review

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use