Marginally Interesting
Books in Pairs: Programming in Scala vs. Programming Scala
· Mikio L. Braun

Books in Pairs: Programming in Scala vs. Programming Scala

I've been using Scala for probably a year now, and I'm actually quite impressed with the language. In most languages, you sooner or later come across something which is just plainly broken. Everyone knows it is broken, but clearly, there is no way to do anything about it, so everyone uses one work-around or another. Surprisingly, although I've come close, all in all the language is really very well thought out and quite powerful and fun to use.

For those of you who don't know: Scala is a language for the JVM (and apparently also for the .NET framework, although I haven't tried that out yet). This means that the compiler produces normal Java byte code and therefore has access to the many existing Java libraries and projects. Other such languages are Clojure, JRuby, or Groovy. Scala is a statically typed language which sees itself as a synthesis of object oriented and functional programming. I've already sung the song of praise for Scala in another post.

Luckily, there are several good books available, of which I've read two this year:

Since the titles are so similar, I'll just stick with the publishers for the rest of the review.

So which of the books should you buy to learn Scala? I'd say both.

The artima book is probably a bit more pure. It covers Scala in all its glory, focusing on different language features in every chapter. Martin Odersky is the creator of Scala, so his understanding of the language is thorough. I would probably go to the artima book first if I wanted to know everything about some obscure language feature.

On the other hand, while there is an extensive number of examples, they feel somewhat academic. Of course, many programming language books are like this, but while the authors make some effort to find relevant problems, I was often left with the feeling that something was missing. As we all know, development in the Java environment has it's ugly places with all those imports, Maven project files, and so on. So if they build a spreadsheet with a few hundred lines of code (they do!), I couldn't quite believe it.

This is where the O'Reilly book comes in. What I really liked about the book is how it is written for people who already have some professional background and doesn't spare you all the nasty details. In the end, the book covers roughly the same scope as the artima book, but at the same time also gives convincing example why and how you would use certain features. I would probably go to the O'Reilly book first if I wanted to know how different language features interact and can be put to good use in practice.

So in summary, I can heartily recommend both. Depending on how you usually approach new programming languages you can pick one of the two books to start and later add the other book to fill in the missing pieces.

The O'Reilly book also covered new features in Scala 2.8, which the artima book didn't, but I just learned that the second edition of the artima book is completed and will be available in printed form in January 2011.

Finally, the O'Reilly book can also be found online on the books homepage.

Comments (3)

B
bugmnt 2011-01-10

I can't agree with you completely. I have only read the O'Reilly book (waiting for the 2nd edition of the artima book) and I thought it broke down somewhere in the middle. A lot of things aren't properly explained and stuff is skipped over or "left for later". I can't recommend that book for a Scala novice. But if you read it make sure to read the Online Errata at http://oreilly.com/catalog/... as a lot of problems have been reported. I really wanted to like this book but I hope a second edition will fix a few of those problems.

Anyway: Thanks for the review!

M
mikiobraun 2011-01-10

Hello bugmnt,

thanks for your comment. Yeah, you're probably right that you shouldn't read the O'Reilly book if you are a complete novice. I personally read the artima book first, so I already had a pretty good overview of the language. I found the O'Reilly book to be a pretty good addition to that book,

Concerning errors, I also found a few errors here and there, so yes, you should probably wait for the second edition!

A
Artem K. 2011-01-10

I agree, as a .NET developer with no JVM background I would like something more structured. Personally I moved to Apress' "Beginning Scala" at first.

Back to all posts