Depending on a pre-compiled jar that is not compatible with Java 8 :(
There is a special place in my heart to hate the new shiny lambdas. Makes code too difficult for reading, nowhere compatible when needing to use Java 7 every now and then.
With the article would just disagree on Sharepoint, would say Confluence has finally replaced that one.
Or are you just saying that lambdas are as bad as anonymous classes?
Quick, what does this do (in Scala)?
(1 to 100).map(x => x * x).reduce(_ + _) ?
Or if you don't like the underscores we could make it more explicit:
(1 to 100).map(x => x * x).reduce {case (x, y) => x + y }
Let's look at the iterative alternative:
var (i, sum) = (0, 0)
while (i < 100) { sum = i * i; i = i + 1 }
You could argue about performance or whatever, but closures are safer, more powerful, easier to read, and more concise.
Using a language without anonymous closures is like programming blind-folded and with one hand behind your back. It's pretty much the definition of Paul Graham's "Blub" languages[1]
Of course, classes are closures and closures are classes. But classes without closures are verbose, stupid, and ugly.
sum = (1 to 100).map(x => x * x).reduce {case (x, y) => x + y }
sum = 0
for i in 1..100 { sum += i * i }
I personally find the second one easier to understand. Performance is much better unless the compiler does some magic to convert the first version to the second one.Adding more logic to the loop also doesn't make the code more complex.