Jump to ratings and reviews
Rate this book

Scala Cookbook: Recipes for Object-Oriented and Functional Programming

Rate this book
Save time and trouble when using Scala to build object-oriented, functional, and concurrent applications. With more than 250 ready-to-use recipes and 700 code examples, this comprehensive cookbook covers the most common problems youâ??ll encounter when using the Scala language, libraries, and tools. Itâ??s ideal not only for experienced Scala developers, but also for programmers learning to use this JVM language. Author Alvin Alexander (creator of DevDaily.com) provides solutions based on his experience using Scala for highly scalable, component-based applications that support concurrency and distribution. Packed with real-world scenarios, this book provides recipes

720 pages, Paperback

First published January 1, 2013

59 people are currently reading
192 people want to read

About the author

Alvin Alexander

19 books15 followers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
40 (25%)
4 stars
81 (51%)
3 stars
29 (18%)
2 stars
5 (3%)
1 star
1 (<1%)
Displaying 1 - 13 of 13 reviews
Profile Image for Christian Roman Rua.
15 reviews6 followers
November 23, 2015
This is a book that is full of simple examples that could give you a kick start in the Scala world, specially if you are coming from Java.
What I liked about this book is that the explanations of most of the recipes are simple and clear, on the other hand, being Scala mainly a functional programming language, there are just few recipes that approach a solution in a functional way.
In conclusion, I would recommend this book to Scala beginners, though if you jumped to the Scala world because you like or want to learn functional programming, you might end up disappointed.
18 reviews
Read
August 27, 2023
Outstanding book , learned some new scala tricks along the way.
Profile Image for Joshua Hruzik.
17 reviews6 followers
January 23, 2021
Scala Cookbook by Alvin Alexander is a 700 pages book containing a wealth of insights regarding the Scala Programming language.

I think it is the best Scala book out there and even beats Programming in Scala which is the defacto Scala reference. This is due to multiple reasons:
* It is focused very much on application and less on theory
* Very concise yet precise examples
* Contains information on Akka

When it comes to O'Reilly cookbooks there are pretty much two different types of cookbooks:
1. They assume that you are already pretty familiar with the language/tool and teach you some pretty advanced stuff (like the SQL or Python cookbook).
2. They assume you had some prior exposure to the language and give you a solid understanding of the entire language (like the R cookbook).

This book definitely belongs to the second category. However, I probably wouldn't recommend it to a total beginner since A Beginner's Guide to Scala, Object Orientation and Functional Programming is a better choice for that in my opinion. However, I'd definitely suggest reading those two books in a row.

A small notice on the edition. The first edition has some outdated stuff (like the MongoDB driver or some Akka functionality) and a second edition is coming up. If you are not in a hurry, you might want to wait for the second edition to be released.
Profile Image for Jasna.
183 reviews2 followers
November 7, 2017
My boss recommended this book to me as a good introduction to Scala since my new job has me writing in it. I read this bit by bit almost every work morning and evening on the train, which worked well with the small recipe format. Coming from a Java background, this book spoke well to me since Alexander assumes this. It's helped me tremendously with my new job and with getting through the (in)famous `Functional Programming Principles in Scala ` course by Martin Odersky on Coursera. The course has been quite difficult, but the book much more approachable for me being a greenhorn with functional programming/Scala and still trying to make up for my lack of a formal CS background. I'm passing on the physical copy to another interested coworker but putting in a few dollars to get a Kindle copy for myself since I find this book valuable enough to be a resource to go back to.

I say all this even though the book is now 4 years old, though it would be nice for the author to come up with a new edition.
Profile Image for Anton Antonov.
351 reviews48 followers
January 30, 2018
Don't expect a long and detailed review. The cookbook is not something you read end to end. It's there when you need it.

Although it's now dating 5 years, it was still helpful to me in majority of the parts regarding "Types", "Idioms" and "Strings".

It explains the best covariant, invariant and contravariant types in Scala which is fairly simple once you get it, but the official docs of Scala is fairly far from the point.

Where the book fell short for me - "Web Services" and "Databases and Persistence" are very library dependent and of course they're dated by now.

Profile Image for Ben.
94 reviews
August 18, 2017
Not really a "Goodreads" type of book but wanted to add it here to mention that even in the days of the internet, these books are worth getting. Google results are basically going to give you the same five Stack Exchange posts over and over followed by unrelated garbage. Plus it's nice and thick so it works great to prop up my monitor at work.
Profile Image for Annette.
39 reviews3 followers
October 5, 2018
Most of those recipes are easily searchable online but I have to admit Alvin has a special place in my heart with how much he helped me in my fp journey so I actually got a soft copy of this book.

Feels classy to sometimes go oldschool at work and look for a solution in a book rather than stackoverflow :)
Profile Image for Sebastian Gebski.
1,187 reviews1,339 followers
November 15, 2013
Honestly, I have no clue who this book is for precisely.

On one side, majority of recipes are really simple, low-level usage examples of basic Scala constructs that will surely help you if you're just learning Scala (syntax & stuff). On the other side - some are a bit more interesting and provide depth beyond that (chapters about SBT, actor model and the last chapter about best practices in Scala).

It's not necessarily a bad composition, but what people are accustomed to get from cookbook-style books are quite scenario-specific recipes, that help them understand the strength of particular technology. This book doesn't really work that way, but I've still learned some things I didn't know earlier, so I find it useful anyway.
Profile Image for Michael Koltsov.
110 reviews69 followers
March 13, 2016
Alvin Alexander has such a nice blog that almost anyone who has a question that has something to do with Scala will definitely end up getting to his website at least once.

I've decided to give his book a try and i didn't get disappointed. First I thought I would skim through it in a couple of hours due to relatively easy concepts and redundant information that I might have known before. Unfortunately (luckily?), that didn't happen.

The book is slightly outdated (who needs Scalatra or pure lift-JSON these days?), though delivers a lot of useful concepts that I've happily put under my belt.

My score 4/5

It needs to be updated + I'd like to remove a lot of worthless water that's poured upon you here and there in the "Discussion" parts of every chapter.
Profile Image for Tom Lous.
42 reviews2 followers
August 24, 2016
Great insights & easy to use recipes. The downside that this book becomes quickly obsolete / incomplete with the dawn of newer Scala versions & libraries. Some of the Scala 2.10 stuff has been improved / changed with Scala 2.11 (as of this writing)
Profile Image for Oskar.
32 reviews1 follower
October 24, 2016
Practical book about Scala with lots of good "recipes" for actual use. Targeted maybe a bit more towards those who are coming from Java.
5 reviews1 follower
April 26, 2023
The book provides additional recipes, samples, details on top official documentation. As someone who is new to Scala, I sure learned a lot from this book.
Displaying 1 - 13 of 13 reviews

Can't find what you're looking for?

Get help and learn more about the design.