Yes. On the other hand - is there a problem with semicolons? They're more easy to type on a german keyboard than curly braces.
If you use parentheses you need 6 extra semicolons, whereas replacing them with curly braces is no extra characters. Usually when people use parentheses + semicolons it for saving space by putting everything on one line (and maybe to make it look a bit more like a Java for-loop).
On a bit of a tangent,
Well - I have a good reason, I want to find the max, and there is no problem, until you find one. Of course, the max-call you use is more elegant, but I think it wasn't available 2009, but a roll-your-own function to use in a fold would have been possible over then too.
That would work if you know you have at least 1 positive value; you could use Int.MinValue instead of 0, but better would be
or equivalently
For Int lists as in the case above, this could be simplified to
This "max" method is the one on Int that has been around forever (I assume...), rather the one on lists that we're trying to emulate.
On even more of a tangent, I've done some research and found you can make a general version of this for anything that can be ordered (i.e. has the Ordered trait) using the Pimp My Library pattern:
(Here
<% is a
view bound which translates into English as "can be seen as". Int is not an Ordered, but can be seen as a RichInt, which has the Ordered[Int] trait.)
So you can now do things like this: