Menu

A very good introduction to Scala

June 17, 2015

Scala is an important milestone in the fusion of functional and object-oriented programming. This fusion is not yet complete, but rather a “discovery process” that will continue for a few more years.

To become an object-functional developer, you still need a lot of background knowledge at the moment, because you have to master the techniques and methods of both paradigms. In the future, an intersection will form there, so that getting started will become easier.

Personally, I knew the functional language Haskell and object-orientation with Java and Groovy on the JVM very well, so I had extensive prior knowledge. But nevertheless, the book was quite a demanding read in the second half.

But the main task of the book — explaining the Scala language — is masterfully handled by the authors. All features (implemented at the time) are explained in detail and in an understandable way. Even now, 4 years later, the book is still the best explanation of Scala. Chapter 25, for example, contains nice advanced examples of integrating your own data structures into the collection framework from Scala 2.8 onwards. However, you need knowledge in the fields of FP, OO, and Java. It is not a beginner’s book, but is aimed at experienced developers.

I have read this book three times now: the first edition in 2009, the second in 2011, and now again in 2015. You can’t read this book through in one go profitably. You have to stop in between and try out the language, invent examples, and ideally use Scala in projects. After the first time in 2009, I initially thought about some parts, “that’s so complicated, I don’t even need that” or “the syntax is too far from Java, no programmer will want to learn that again.” But over time, you notice that many things can be modeled very well with Scala traits, classes, and objects, that Scala is a very elegant language, and that covariance and contravariance are also important for implementing your own collections.

The book was published in 2010, but is currently only outdated in small parts. Today, GUIs are created with JavaFX and not with Swing; the Scala actors are deprecated. Unfortunately, important new developments are also missing, such as parallel collections (from 2.9), futures and promises (2.10), reflection (2.10), and macros. Also, the frameworks Akka, Play, and Spark did not exist back then and accordingly do not appear. However, they would also go beyond the scope of the book.

So: getting started with Scala is easy, but making progress then requires practice and you have to keep picking up the book and programming examples.

Scala is a very rich language, and this book is still the best introduction. It is not always easy, but it is worth it.

  • Martin Odersky, Lex Spoon, Bill Venners
  • Programming in Scala
  • Artima
  • 2010

See also the review on Amazon.

categorySoftware Engineering