Å·±¦ÓéÀÖ

Jump to ratings and reviews
Rate this book

Programming in Scala Fifth Edition: Updated for Scala 3.0

Rate this book

Programming in Scala is the definitive book on Scala, the new language for the Java Platform that blends object-oriented and functional programming concepts into a unique and powerful tool for developers.



Coauthored by the designer of the Scala language, this authoritative book will teach you, one step at a time, the Scala language and the ideas behind it.



The book is carefully crafted to help you learn. The first few chapters will give you enough of the basics that you can already start using Scala for simple tasks. The entire book is organized so that each new concept builds on concepts that came before - a series of steps that promises to help you master the Scala language and the important ideas about programming that Scala embodies.



A comprehensive tutorial and reference for Scala, this book covers the entire language and important libraries.

898 pages, Kindle Edition

First published January 1, 2008

490 people are currently reading
1,434 people want to read

About the author

Martin Odersky

9Ìýbooks33Ìý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
719 (43%)
4 stars
656 (39%)
3 stars
222 (13%)
2 stars
46 (2%)
1 star
14 (<1%)
Displaying 1 - 29 of 101 reviews
216 reviews15 followers
March 26, 2009
Woah. Amazing! This is a great book. Excellently written. Of course it couldn't be a great book if it weren't for the fact that Scala is a totally awesome language. When I was teaching myself Perl, I had to read the book (*the* Perl book, _Programming Perl_), two times in order to get it. It was just so different from any programming language I had previously known, that I just couldn't get it the first time. I knew pretty early on into the Scala book that I would have to read it twice, for the same reason. This has never happened to me besides with Perl and Scala. Most programming languages are, well, pretty similar to some other programming language I already know. Scala is revolutionary. Don't mis-take me; I've done plenty of functional programming before. Perhaps if I had used Erlang before instead of Scheme, Scala might seem a bit easier. But in any case, wow. Everything about it just feels so awesome. Like if you just figured out how it was supposed to work, programming would be so easy, without any painful boilerplate, with language features to address scalability design problems that more traditional languages like Java just cannot handle. Of course, learning how to use it right is not going to be easy. If it were, it could never be so powerful. This is clearly a very carefully designed language, and designed by some very thoughtful and intelligent people with lots of experience in both programming and language design. All this, and the whole Java runtime at your fingertips. I am sold, 100%.
Profile Image for Rod Hilton.
151 reviews3,117 followers
September 17, 2012
I've heard a lot of people refer to Programming in Scala as "dry" or "boring". I think this description is not accurate, and a more accurate description is "thorough".

Programming in Scala is not a book to get you up and running in Scala quickly, writing good Scala code as soon as possible. This book is about UNDERSTANDING Scala, and not just how to use it, but how it works internally, what aspects of it are merely syntax sugar, and what that sugar is converted to under the hood. It covers aspects of the compiler, the equivalent Java that Scala is being converted to, and virtually everything else. Programming in Scala puts you in the mind of the designer (no surprise, since most of the book was written by Scala's designer).

No stone is left unturned, no aspect left unmentioned. Programming in Scala is everything you would ever need to know about Scala and more. In fact, I wound up skipping a few chapters at the end, because I don't particularly care about GUI programming or parsing XML. This is THE Scala Bible.

If you're looking to get up and running in Scala soon, understanding enough to be a really good programmer with Scala, you want Scala for the Impatient by Cay Horstmann. But if you're the type of person who sees "magic" in programming languages and wonders why the hell that works at all, Programming in Scala is your book. It helps establish the underlying RULES of the language, the kind that, once you understand them, you can PREDICT how Scala would probably implement something.

The book is very long, and very dense, but it is not dry. Really good examples throughout, though sometimes the examples are so complex that the reader's brain devotes more time to understanding the examples than to learning the principles they wish to establish.

Overall, a very good Scala book, but perhaps not an ideal FIRST Scala book.
Profile Image for Yamir Encarnacion.
21 reviews3 followers
February 3, 2014
After completing about 40% of the book according to my Kindle for iPad this is what I have to say.

Things I love about the book:
(1) the Kindle for iPad edition was very well formatted (has a hyperlinked table of contents, hyperlinks throughout the book, chapters start on a new page, well formatted and easy to read code examples)

Things I like about the book:
(1) thorough (the book covers a lot of material)
(2) clearly written with no obvious typos/errors
(3) liked the way each chapter was organized. An Introduction followed by a more thorough discussion of the topic at hand followed by a summary of what was covered
(4) This book will work well as a reference after reading it as it is organized well enough that you can jump straight to a particular topic

Things I dislike about the book:
(1) choice of chapter order was not apparent to me. The book feels more like a lot of very well written tutorials, each covering a well defined topic, instead of a single unified tutorial (which is what I was expecting) with the goal of taking the reader from novice to a more advanced level.
(2) code examples are more complicated than they need to be
(3) the Kindle ebook does not have page numbers

Other thoughts:
I am of the opinion that this book will not get you up and running quickly. You have to read quite a bit before you get to a point where you can write useful code (I would suggest reading at least up to and including chapter 17 -- My Kindle tells me this is 38% of the book -- when you consider that the paperback version has 852 pages, 38% translates to around 320 pages of book material). Also, I believe that Scala is different enough from other languages I have used or studied that I think that (at least parts of) the book would have required a second reading or I would have to have followed up this book with a different book (I did something similar -- see More on getting up to speed quickly below) before I could be effective with the language.

More on getting up to speed quickly:
Before writing this review I also started taking the Coursera course () on Functional Programming using Scala taught by one the authors (Odersky). The course material is available even though the class has ended. There are only 7 days of college course style lectures with each day’s lecture lasting between 1 and 2 hours. If you want to get up to speed quickly, I highly recommend that course. I was up and running after the first day’s lecture. The course is a good way to follow up on the material in the book.

Finally:
I gave this book five stars because this book is superior to other programming books I have read in terms how it is written (format), the material it contains (quantity and quality), how clearly that material is presented (readability), and how long I think the material will remain useful for (durability). I do not rank a lot of my books with 5 stars. I believe that I got a very good bang for the buck.
Profile Image for Andy.
19 reviews
November 11, 2011
This is how a book about a programming language should be written. It gives you the basics, but also provides details that you should know to be effective and efficient using Scala. What makes the book really great is that it is useful even if you aren't planning on writing a line of Scala. There are a lot of good programming practices and patterns that are given in the book (both explicitly and implicitly).
Profile Image for Vitor.
16 reviews8 followers
March 11, 2018
TL;DR: This is the book to go if you want to feel comfortable about Scala, but it takes time and patience from the reader. The examples in this book won't teach you how to build complex systems. The Kindle version is perfect.

This book will teach you all the magic behind Scala. I liked this book a lot because it's simple to understand and clearly explain why some things happen in Scala. If you want to feel comfortable working with Scala, then this is the book to go.

However, it requires some effort and patience from the reader. For instance, I was expecting to learn about case classes, implicits and for comprehension right off the bat, but it took me 15, 20 and 23 chapters, respectively, before deep diving in it. I had to read about things that usually don't matter at first (but as important) such as Packages and Imports, Abstract Members, Scala's Hierarchy, Unit testing, etc. I felt that the chapters could have been sorted differently.

Another down side of this book is that most examples don't follow software engineering good practices and the reader has to be really careful about it. I strongly suggest reading after you finish this book. If you are looking for a book that will teach you how to build complex systems in Scala, this is not the book you want to read. The author is really clear about having short and concise examples to save the trees, so don't expect to see beautiful and clean code here.

To sum up, this is a really good book and you'll finish it feeling prepared to work with Scala, but it requires patience and time from the reader.
26 reviews10 followers
November 2, 2010
From

"...
For those, who want to learn more about Scala, I'd like to recommend very good book, actually one of the best books I read this year. Despite the fact it's a technical book I would compare it to reading Harry Potter. Simple language, easy to understand, short chapters and can't stop reading it. Here is the link: Programming in Scala by Martin Odersky
..."
Profile Image for Keith.
93 reviews81 followers
May 20, 2016
Pretty good fuckin' programming book, okay?!
Profile Image for ³§¾±´Ç²ú³óá²Ô.
351 reviews41 followers
January 15, 2022
Tips for learning Scala from someone who did it against their will and is now the senior most Scala engineer in their office somehow*:

1. Google around for Twitter's material on Scala (specifically and ) and work through it.
2. Attempt some Scala. Be bad at it. Hate Scala. Swear it's the dumbest language ever invented and what on earth is functional programming doing.
3. Return to the Twitter material vaguely understanding better what Scala is and why it's the way it is.
4. Make peace with Scala.
5. Read this book, cover to cover —Ìýand I mean cover to cover.
6. Conquer the world.�

Now for the actual review

I just realized while cleaning up my CS shelf that I'd never marked down this book as having been read. And what a shame! Of all the books I read while starting to learn Scala and functional programming, this is the only one that was worth reading and the only one that was helpful.

Because honestly reading this book, written by the person who created Scala, really helped me grasp the language, see how I can use it, see where I can play with options, and get really into the nitty gritty as much as I wanted to.

You do not need any other book to learn Scala beyond this one. I read so many before this that were all meh at best, but this one was nothing like the rest.

*Yeah, I don't know either, but I've made it to step six so maybe that's why.

� Not optional. Sorry.
Profile Image for Sebastian Gebski.
1,151 reviews1,258 followers
June 5, 2013
Quite likely the best book on Scala - not really surprising as it was co-written by Martin Odersky - Scala creator. The book itself is veeery comprehensive and details - some sneak-peaks inside collections' internals are indeed very astonishing. It's also well structured (contrary to some other Scala books), so the learning curve is as filed as possible (for Scala - so it's still not trivial).

I like the examples as well - especially the large-scale ones that are perfect to illustrate the general idea of functional programming in Scala.

What I didn't like? Book is ancient in its form - just text and code samples: sometimes a picture is worth more than 1000 words. It's not 100% up-to-date as well: content is based on Scala 2.8.1.

Anyway, if you're planning to learn Scala - I'm pretty sure you won't find a better resource to aid you.
Profile Image for Rahul Goma Phulore.
22 reviews6 followers
October 4, 2012
Still the best book to get into Scala. A few complaints:
1. A lot of it needs to updated to the current language version.
2. Some examples in the book are mentally taxing and drive attention away from the main topic.
3. Type classes deserve more attention.
4. Their should be a greater emphasis on language philosophy.
Profile Image for Imran Kazi.
36 reviews6 followers
December 1, 2017
Odersky is a poet of computer language and Scala is his haiku.
Profile Image for Coda Apple.
39 reviews1 follower
February 8, 2024
Wirklich furchtbare Sprache und Grammatik.
Kann aber der Autor mit seinem Buch nichts für.

Alles schön und gut aber mittlerweile nicht mehr auf aktuellen Stand. Hat mich viele tränendurchnässte Nächte durchs Studium begleitet.
Danke fürs Ausleihen, Phillip.
87 reviews5 followers
July 12, 2016
Ok, just finished reading this book, well, I agree with those majority of readers that this book is "must read" for every Scala dev. Even it is written by creator of Scala, the guy with pure and strong scientific and theoretical background, the book is read quite easy, trust me, I am a C++ dev, I've read corresponding C++ Stroustrup's bible, it is nightmare, this Scala book is just a teenage comics
comparatively to C++ sibling book.
Profile Image for Eric Casteleijn.
11 reviews5 followers
December 19, 2014
Scala is probably the worst programming language I've had the misfortune to use. The syntax and the way the compiler works make it feel like a rushed experiment. This book either flaunts the flaws of the language, or jokingly dismisses them. If you're forced to program in Scala, don't buy this book. I hear "Scala for the Impatient." is better, but best of all just try to avoid it altogether.
Profile Image for Jordan Howe.
3 reviews4 followers
Currently reading
June 13, 2011
Great book. Peppered of dry jokes. Like "now you are *literally a Scala expert. Footnote: *figuratively speaking".
Profile Image for Paul.
15 reviews76 followers
March 31, 2013
Not a lot to say here, other than: not optional if you're a Scala developer!
17 reviews
December 28, 2016
This is best book on Scala. This serves as a good reference to re-read concepts about Scala
5 reviews
March 1, 2017
Occasionally, it felt like the authors were showing off their cool programs (a layout framework to draw ASCII spirals and a circuit simulation) instead of discussing the Scala language.
Profile Image for Dang-Khoa Le Tan.
35 reviews14 followers
December 23, 2021
I really love Scala. It mixes between object-oriented programming and functional programming with nice touches regarding type parameterization, generic and context parameters. Given a sheer amount of new syntax, I guess it would be a difficult language to master. Nonetheless, I think Scala definitely is a good language to learn. Somehow I got the feeling that Scala is more approachable than Rust although in some degrees both languages seems to hard for layman. I sometimes got headache while reading Rust books despite many attempts to learn this language.

The book itself is well organized, has good pacing and a variety of useful examples. It's nice when the authors tell you when to skip certain parts of the book because of its theoretical discussion. I got hooked immediately after the first few chapters and couldn't put it down. The language itself is a new treasure island to explore and the book is a whole new expenditure.

Here are some chapters I thoroughly enjoy:

- Givens.
- Type Parameterization.
- Pattern Matching.
- Control Abstraction.
- Functions and Closures.
Profile Image for Pablo.
70 reviews3 followers
January 25, 2020
An excellent book for learning Scala, with a good balance between depth and approachability. The examples and the issues raised are interesting and illustrative, and the organization is sound, interleaving chapters with an object-oriented and functional focus.

I would have liked to have some solved exercises so that I could test my understanding on the go.
It would have been enough with a more clear statement of what features the developed examples were going to have.

The edition I read (3rd) is also apparently outdated on some aspects (at least, some of the examples raise deprecation warnings), but it seems like that is solved in more recent versions of the book.
Profile Image for Joshua Hruzik.
17 reviews6 followers
December 19, 2020
Programming in Scala is a very thorough introduction to the Scala programming language. It shows you the basics you'll find in any language as well as all the details that make Scala special in great detail.

The examples are very concise and are great to demonstrate new concepts. On a more critical note, the object oriented part could have received a little less attention while the more functional approach could have received more.

For a total Scala beginner I would advise a short book like A Beginner's Guide to Scala Object Orientation and Functional Programming by John Hunt. After reading that book,Programming in Scala was much more accessible to me.
Profile Image for Anita.
14 reviews
June 11, 2017
I highly recommend reading it. I have read this book after about a year of using Scala in my daily programming job and I have still learned a lot. What is funny more about the syntax in the first few chapters. This book is a tutorial but it gives you insight into decisions that need to be made while designing and implementing a programming language. You can also learn how some features were intended to be used, as seen by language authors. It is a long read but with click after a click you will eventually get to the end and you will have a sense of satisfaction.
48 reviews1 follower
December 29, 2017
Comprehensive and complete, but personally I tend to prefer more in the way of hands on exercises to learn a new language, where this book provided more of an API / language architecture overview. I came out finding that I felt I knew the parts of the language, but not yet how to practically use them. I'd recommend it to anyone serious about Scala, but if you're like me, you'll also want some supporting additional reading to fill in the practical gaps.
Profile Image for Alvaro Tejada Galindo.
178 reviews5 followers
July 21, 2017
Pretty nice book about Scala...well explained...however...it really didn't fit with me...I feel it kinda rigid and not casual...good reference but prefer a different writing style...

I know...it's a programming book not a novel...but still...and yes...I know...it was written by Scala's author...but still...not my first choice for a Scala book...
16 reviews2 followers
March 25, 2018
Nice intro to Scala. Especially the discussion of case classes and pattern matching was better than most of the on-line materials. The coverage of concurrency could have been better (the examples didn't really show how to deal with threads in asynchronous scenarios). A nice bonus: this book improved my knowledge and understanding of Java.
Profile Image for Piotr Kalinowski.
53 reviews22 followers
May 29, 2018
Very well structured and comprehensive guide

This a very well structured guide throughout basic and more advanced features of Scala, gradually introducing more and more complex topics.

I particularly liked the fact that many of the included examples were of somewhat higher complexity, for example, a 2D text layout library. I think it helps to engage with the material better.
Displaying 1 - 29 of 101 reviews

Join the discussion

Can't find what you're looking for?

Get help and learn more about the design.