The learning curve of Scala

Early Sunday morning, Prismatic did that really annoying thing it does where it sends me articles that I cannot ignore and MUST read. This time around I had to read the aptly-titled I Don’t Like Scala. I initially resisted the temptation to respond, but I failed and failed more by writing this post.

In that blog post, he makes 10 points. Here I’ve summarized/addressed his points in reverse order.

  1. steep learning curve
  2. He finds Scala and functional programming difficult.

  3. annotations, enums, reflection
  4. See also, steep learning curve

  5. IDEs used to be terrible.
  6. True, but see IntelliJ 13 Scala plugin

  7. slow compilation
  8. True, but it’s because the compiler does a lot. I mean a LOT, much of which I assume would otherwise be done at runtime. See also, static typing.

  9. irrelevant compiler errors
  10. See also, steep learning curve

  11. random failures
  12. See also, steep learning curve

  13. not smoothly integrating with existing java frameworks and tools
  14. See also, steep learning curve

  15. binary incompatibilities
  16. True, but mostly just an inconvenience. You can always compile the older libraries yourself. You just have to become familiar with sbt, etc. Oh, so see also, steep learning curve

  17. it’s cryptic
  18. See also, steep learning curve

  19. there are multiple right ways to do the same thing
  20. See also, steep learning curve

Now don’t take this as a personal attack against the guy. I don’t know him, and I have no doubts he’s a fantastic software developer. But his post is an example of what I’ve noticed out of folks who play with Scala for the first time. It all comes back to the learning curve. People think it’s a hard language to learn, so they don’t like it.

Typically I hear these complaints from people who have no prior exposure to functional programming. Indeed, many of the points in that article were related to solving problems in that new paradigm or solving them without the paradigms/idioms offered by Java. I received this same complaint often from my junior developers early on in our current Scala project. Scala gets the blame, but a bulk of the intellectual difficulty is the result of throwing away all you’ve learned about programming and starting over. Think about the learning curve you scaled to get to where you are today with Java or whatever language(s). Software has a steep learning curve. It’s why most of us have a four-year degree from a university before we land our first job practicing it.

I suspect that had he first learned functional programming (Scala or otherwise), he would have written the reverse post lamenting over the difficulties of programming in an imperative object-oriented language like Java. It really is quite different. I know this, because I had years of nothing but Java experience prior to my Scala exposure. I also think developers in this situation quickly get frustrated because they already know how to build a non-trivial application in their familiar paradigms and languages, but now they’re faced with a handicap which greatly inhibits the progress they are accustomed to. I feel it’s akin to learning a second natural language and getting frustrated that you’re unable to write a scholarly article in that language after the first few weeks. A new language takes time, and a new paradigm takes more.

He does mention a few things that aren’t particular to functional programming, and I agree with him. The learning curve of Scala doesn’t begin and end there. It is a multi-paradigm language. So of course there are more than one way to do things. Yet, this isn’t novel to Scala, is it? In Java you can use while, for, or do {} while. Similarly you can choose to use several if else blocks or a switch statement.

Again, I’m not intending to single this guy out or anything. It just happened that his post was the last I could read without saying something. I agree that Scala has a steep learning curve, but that’s because it’s software. I just get a little frustrated when I see someone throw their hands up and proclaim the problem to be the tool. Just hang in there with it. A learning curve is expected to slow you down, but it shouldn’t stop you.

I certainly don’t expect to see and end to the negative banter against Scala for that matter. After all… There are only two kinds of programming languages: those people always bitch about and those nobody uses. — Bjarne Stroustrup

Tagged with: , ,
Posted in Software Development, Technology
3 comments on “The learning curve of Scala
  1. I’ve heard a few complains like this, specially for syntax. for example, a guy said syntax is so complex and specifically talked about methods that their name begins with :colon. In my opinion that’s not a good excuse because such rules are: A. universal. B. there’s a few of them.

    I mean how much is it hard to know that fooObject() actually is fooObject.apply() or “1 :: 2 :: Nil” is “Nil.::(2).::(1)” ?

    • barnesjd says:

      I agree completely. These are strange features indeed. But wasn’t all code really strange the first time you saw it?? :)

  2. […] be honest here. Scala has a huge learning curve for many folks, as it is attracting droves of developers unfamiliar with the functional programming […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 623 other followers

%d bloggers like this: