Scala – Complexity or Freedom of Choice?

Is Scala Too Complex?

Jessica Thornsby

Pro-Scala bloggers argue that Scala’s complexity can be attributed to its conciseness and the options it offers developers.

There has been some debate recently, as to whether Scala is “too complex.”

One blogger, has recently theorised that the ‘complicated’ misconception, arises from the differing mindsets of the object orientated programmer and the functional programmer. To a developer familiar with object orientated languages, a functional language like Scala will inevitably feel different and confusing.

He also writes that the shift necessary to get from object orientated programming, to a functional style, is not actually as daunting as it may seem: “In Java we use immutable objects when programming for concurrency. We use anonymous inner classes to simulate lambdas and closures. We use iterators and predicates to simulate list comprehensions. We recognize these and other functional concepts but implement them in roundabout ways because there is no direct support for them in the Java language.” If you’re a Java programmer, then maybe you’re already thinking in a functional way, but are unaware of it. Far from being complex, he views Scala as a useful new language for Java developers, allowing them to transition to functional programming, without sacrificing their object orientated skills or even leaving the JVM platform.

Martin Odersky also makes the case for Scala. He acknowledges that some parts of Scala may be complex – he calls some of the core libraries “extremely intricate pieces of software” – but that, in terms of user experience, Scala is “very simple to use.”

There is some evidence of Scala being used as a spring-board for young programmers within an educational context. The Kojo desktop based software application is a prime example: it targets children, and is Scala-based. Kojo aims to help youngsters get to grips with programming basics through creating computer art and animations, and exploring geometry and algebra.

Odersky also argues that Scala’s supposed complexity, is really just the freedom of choice. Although Scala has limited concepts, those concepts are very general and orthogonal and can be combined in a variety of ways. This can create the illusion of complexity, by providing multiple routes to the same conclusion. Odersky also claims that Scala’s conciseness can add to the notion of complexity, since each line of Scala does more work “you could argue it’s harder to understand than a more verbose language.”

The current release of Scala is 2.8.

Inline Feedbacks
View all comments