The fastest way to learn Scala


About once a week, someone on the Scala subreddit asks for advice on how to learn Scala. The answers are usually varied, some people suggest starting with Runar's book, others with the Coursera course. In my experience, most newbies eventually succeed in grasping the language, but it doesn't mean they learn a new skill set in the most efficient way possible.

Scala books

When it comes to Scala books there is obviously "Programming in Scala" by Odersky, Spoon, Venners. The third edition released recently features Scala 2.12, but the content is mostly unchanged from the previous edition. It is probably the most comprehensive and authoritative guide on Scala. Martin explains not only how to do something, but also why he designed the language this way. The book is almost 900 pages, but it's not a difficult read and I personally managed to finish it in about three weeks. The book mostly concentrates on language features and doesn't dive into the Scala ecosystem.

When I was starting out, I got a copy of Venkat's "Programming Scala" and I quite liked it. The second edition released recently is called "Pragmatic Scala" and is under 300 pages.

Again, it's mostly about the syntax, but it's a good book and it's very concise. Also, there are several good presentations about Scala made by Venkat. If you don't know anything about Scala, I highly recommend starting with his "Scala for the Intrigued".

Learning functional programming

One of the most popular courses on Coursera is "Functional Programming Principles in Scala". I even met quite a few people who were introduced to Scala by taking this very course. However, I don't recommend it for learning the language. If you need Scala for work, taking this course will be very inefficient. You will end up spending a lot of time and effort while gaining very little in practical terms. The same goes for the "Functional Programming in Scala" book. While this is arguably one of the best CS textbooks ever written, it is not about learning Scala.

In my opinion, concentrating on the function programming aspect when learning Scala is very overrated. If you want to use the language for building useful things, it's extremely unlikely that understanding applicative functors will be crucial for finishing the project. Having said that, it's worth investing some time in learning basic functional features like pattern matching and currying, because it will make you more productive right from the beginning.

Frameworks as part of the learning process

I noticed that beginner books rarely talk about libraries and frameworks. At the same time, using a good framework, for example Play, makes it very easy to dive into the language and start using it immediately. In fact, while developing a model Web application in Scala on top of Play, it is very natural to learn what functional features Scala has to offer and also understand first-hand why they are so useful.

So, my book - "Modern Web Development with Scala" - includes a short Scala tutorial, which teaches fundamentals, but mostly concentrates on using real-world Scala libraries and frameworks (mostly Play, but also many others) for building useful things. You can read more information about the book on this website or on Leanpub.

Mastering Scala

Contrary to popular belief, Scala is not very difficult to learn. Granted, there are several advanced topics, but most of them are for library designers, so you can postpone learning them for at least a year. I think that the fastest way to become a master is to quickly learn the basics and then start building an app of your own on top of a well-established framework. There are many good frameworks in Scala, but for me Play worked out very well.

I recommend to start by reading first three chapters of my "Modern Web Development with Scala" (available for free on Leanpub as a downloadable PDF). This will cover all the basics and commonly used functional features. After spending a couple of hours on this, you will get a pretty good understanding of what Scala is about and where to move next. Finally, when you need a more comprehensive guide, there is always "Programming in Scala".