August 25, 2006
Seeking the Joy in Java
He’s asking: “How much more productive would I be with closures in Java?”
I’m asking: “How many hours (days? weeks? months? years?) have I already spent with writing unnecessary Java statements?”
Everytime I wrote
for ( int i = 0; i < myArray.length; i++ ) { myArray[ i ].callIt(); }
it could have been
myArray.each { |i| i.callIt(); }
Even worse: All the little function blocks that could have been used as 'delegates'.. What did we do instead? For all those years? Write a full class. Or at least an anonymous class. And that is obviously only the tip of the iceberg.. Thanks, James! :)
tfdj
Filed by The.French.DJ at 12:10 am under Development, Java
No Comments