I eventually took time to enroll to Functional Programming Principles in Scala on Coursera and the lecture about evaluation strategies really shows an aspect in which most mainstream languages are really a pain: Scala has a natural built-in way to specify lazy evaluation of parameter values. It is not the only language doing it, but the syntax is just neat.

In Scala one can expect arguments to be passed already evaluated if the actual value is actually always needed during the execution of the function:

def addOne(x: Int): Int = x + 1

But if one value is needed only for some execution paths one could also specify it. The actual value is only reduced when needed, and if not needed at all the value is simply omitted:

def alternative(c: Boolean, left: => Int, right: => Int): Int = if (c) left else right

One can see lazy evaluation by creating a producer that never terminates (example from the course slides), it is never actually called so the following terminates:

def loop(): Int = loop
alternative(true, 5, loop)
alternative(false, loop, 10)

In a sense Java 8 will come with the Supplier functional interface that helps in that direction, a method could accept a supplier of the excepted type instead of the actual value.

But Scala still gets it better by having it baked in the language and making its usage transparent to use any of both paradigms: just take the one which applies best. One advantage is that if the caller naturally has a value, for example the operant is a constant and it does not consume resources to get it, it can just call the method with that value (just like 5 and 10 in the above example). And the other way round works too, if one was to return a value and returns a supplier, Scala will reduce it until it produces some value (what it does for loop above and which never terminates).

This may not seem like much, but it makes code much easier to read and that makes our developer life better.