Refactoring to a Closure
"jcsextro" <[email protected]>
| Newsgroups | gmane.comp.programming.refactoring |
|---|---|
| Message-ID | <[email protected]> |
Below is a blog post I have written about Java and a straw-man proposal to add closures to Java 7. I am interested in your thoughts about this.
http://www.agileevidence.com/
Does Java Need an 'Extract Closure' Refactoring?
A straw-man writeup has been proposed by Mark Reinhold for including Lambda expressions (or Closures) in Java 7.
Over the course of my career as a developer I have never used a language where closures were a tool in the developers' toolbox. Because of this my brain does not create solutions using closures. Since my conversion to Test Driven Development I work hard to ensure that I am implementing the simplest solution possible for the feature that I am developing. For this reason I have titled this post "Does Java Need an 'Extract Closure' Refactoring?" rather than something more obvious, such as "Does Java Need Closures?"
I won't write any code using closures because a closure isn't the simplest thing that can work. I know this because of the millions of bits of code that I have already written in Java without closures.
The only way I can envision myself using a closure would be as the result of a refactoring. For me to extract code into a closure it will have to make the code easier to read and/or improve the reusability of the code.
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/refactoring/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/refactoring/join
(Yahoo! ID required)
<*> To change settings via email:
[email protected]
[email protected]
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/