this post inspired by Volkswagen’s excellent marketing campaign ‘Drivers Wanted’
An unfortunate meme1 dogging Scala is the notion that it is a notoriously complicated language. For better or worse, I do believe that the lion-share of this general perception is fueled by both fear and lack of familiarity. That’s not to say that Scala doesn’t have its share of complexities, instead the fearful perception doesn’t map to the realities of the language experienced after consistent usage. Having said all of that, I think it’s important to note that Scala is designed to solve very hard problems and because of this there is a definite set of highly abstract ideas that, if one is unfamiliar with it or languages like it, possess a very sharp learning curve. However, an important point to ponder regarding learning curves is this:
The complexity of a language cannot be defined solely in terms of the pain felt in the initial stages of learning.
– me
Let’s try to attach a picture to this idea.
If someone (me again) familiar with both Scala and Java were to describe the complexity curve of the former it might look something like this:
A description of this image could be described as such:
"Hello World"
example and the fact that it is super-easy to
write Java-flavored ScalaThis complexity curve is indicative of the most powerful programming languages.4
If someone familiar with both Scala and Java were to describe the complexity curve of the latter it might look something like this:
A description of this image could be described as such:
"Hello World"
example and the fact that Java is designed
for ease of introduction 5This complexity curve is indicative of partially powered programming languages.
I can’t stand cars. Nothing is more boring to me than car talk. I like a car that will get me from here to there with reasonable fuel efficiency and safety. That’s it. I can appreciate the beauty and power of an Alfa Romeo 8C Competizione, but it doesn’t serve my current needs.
However, if I ever have the need for a fast get-away6 then my car will fight me at higher-speeds and then eventually simply break-down. Clearly my car is not designed to meet the needs of a fast-paced environment and because I’ve never had such a need neither am I.
Scala is an Alfa Romeo.
Drivers wanted.7
:F
FUD?↩︎
My language has more paradigms than yours coming soon to a t-shirt near you.↩︎
That’s not to say that there is no room for improvement in Scala’s handling of powerful abstractions. For example, the hoops required to facilitate the use of type classes in Scala are extremely cumbersome. Scala would be better served by a first-class syntactic treatment of type classes, but I alas I have not thought this through to its logical end and am ready to be convinced otherwise.↩︎
Some of these powerful programming languages are found in my blog post about Perlis Languages.↩︎
A alternative, but wholly inflammatory way to describe this post can also be stated as: Scala helps programmers solve hard programming problems - Java helps human resources solve staffing problems. But I thought this might be a little over the top. Funny yes, but definitely over the top.↩︎
No one expects the zombie apocalypse.↩︎
However, there is a lot of effort spent on the matter of Scala’s perception of complexity. I’m of the opinion that those involved in its development and marketing should just step back and say “Yeah. So what? So is Spring. Programming is hard and only set to get harder and Scala can help you meet these growing complexities.” Any time spent on the development of Scala that does not directly benefit “drivers” is time wasted IMO.↩︎