One of the goals of Scala is increased consistency compared to Java.
Here are three high-level consistencies in Scala:
- Every value is an object. There are no primitives in Scala. Even its version of void (Unit) is an object. Nothing is an object. Nil is an object. Arrays are objects. Everything is an object.
- Every statement is an expression. Every line of code returns something, if only Unit. Every “if” statement, every block, everything is treated as an expression.
- Every operation is a method. There are no primitive functions; even + is a method on a number object. And because methods can be passed as values in Scala, this means every operation is also an object.
The result of this consistency is a collapse of distinction between the smallest parts of the language and much larger, constructed parts — hence, a SCAlable LAnguage.