Disclaimer: I received this book as part of the O’Reilly Blogger Review program. The opinion about the book below is only my own!
Since O’Reilly published the Perl Cookbook many years ago I have become a huge fan of that style of books. Back then – when I was still using Perl – this book was a tremendous help for all kind of things I wanted to do with Perl. Later the Ruby, Python and Java cookbooks were equally helpful.
Now O’Reilly has pubished a Scala cookbook and I am extremely happy with the result. The book is pretty big with more than 700 pages (and an extra chapter on Play is available from the author’s website because it didn’t make it into the book).
The book covers many things you will encounter daily in your Scala projects from creating classes, using Scala’s amazing collections, reading files to working with actors (using Akka).
Each recipe has a problem, shows and solution and then goes into detail explaining the solution. If you already know other O’Reilly cookbooks, you will be very familiar with the book’s style.
My favorite chapters are the ones on functional programming and the Scala collection library.
The chapters on functional programming are very pragmatic without much theory. You won’t find advanced discussions on Monads (there are other books for this and many websites) but many very useful tips on how to create your own functions and use them (as well as the existing ones from the Scala standard library) effectively in everyday projects.
The two chapters on the Scala collection library are about 130 pages long and explain in great detail the amazing features of what I consider the best collection library for any programming language out there.
The writing is clear and very easy to follow and the sample code is easy to read. Because it is all in small recipes you don’t need to read through lot’s of theory to figure out how to open a file or write a partial function.
If you are a beginning or intermediate Scala developer the Scala Cookbook is a must have. Even advanced Scala developers should save time looking up solutions from the book – you just can’t have everything in your head
This book would also make a very good second Scala book to deepen your knowledge after you’ve read an introductionary book (Scala for the Impatient by Cay Horstmann is my favorite)
More information from the publisher: