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

No comments yet. Be the first.

Leave a reply