Sep 2, 2011

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.

Scala’s cliff of insanity

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:

The initial smoothness is indicative of a simple, low-ceremony "Hello World" example and the fact that it is super-easy to write Java-flavored Scala The massive spike is indicative of the reality that Scala is a very powerful language chock full of powerful abstractions, syntactic flexibilities, and paradigm-ness2 Eventually one comes to learn how the powerful features can be properly used and how robust and maintainable Scala code is constructed However, another spike hits when one learns that the powerful abstractions are building blocks for even more powerful abstractions Eventually, the complexities of the language itself become second nature, make sense in the context of the whole, and stay out of the way,3 leaving one to concentrate on the problems at hand

This complexity curve is indicative of the most powerful programming languages.4

Java’s cliff of inanity

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:

The initial smoothness is indicative of a simple, but ceremonious "Hello World" example and the fact that Java is designed for ease of introduction 5 The moderate spike is indicative of the reality that good object-oriented programming is hard However, while the complexity curve’s slope decreases, it continues to climb. The reason for this is that Java is chock full of incidental complexities, language foibles, and type system inconsistencies Alas with the help of powerful IDEs, one can eventually come to gripes with the foibles. However, the language never gets out of your way. There is a definite, tangible limit to the abstractions provided by Java and these limitations constantly impose additional complexities on the already complex problems one is trying to solve

This complexity curve is indicative of partially powered programming languages.

Cars

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