I didn’t think anyone would seriously ask this question. However, after yesterday’s post about why your company should let you use Scala at work, which used a simple example showing the use of lambdas in Scala, I had someone write in the comments:
“java 8 equivalent of your example would be identical, no need for Scala…”
and someone else commented on Twitter:
@evolvable @gbougeard It would be nicer if you’d update the code to use Java 8. Plus I don’t agree, but that’s a different case 😉
— Erik Pragt (@epragt) August 4, 2014
The call to compare against Java 8 is a fair one, so here we go… Continue reading
The funny thing is that lambdas don’t, by themselves, do anything new. They’re just a succinct form for turning a block of code into an object that can be passed around – syntactic sugar. Some of us have been doing this for a while without the succinctness and we call it… object-oriented programming! Yes, passing blocks of code (aka functions) around as objects (aka values) is also core to functional programming, but certainly not unique to it.