This is an important book, the only one that goes into the nitty gritty of "modular abstractions", app design and configuration, Dependency Injection/IoC, whatever you call it in scala. The two main language tools are:
- implicit conversions and parameters, (Different authors' vocabulary is confusing. Implicit views are conversions, Implicit "values" are ___).
- Scala's type system: traits, classes, companion and package objects, "type" and "object" keywords, identifiers, scope/namespaces. Linearization and delegating to .super().
Other topics
- Path dependent types and type projections, Chapter
Things not mentioned (
not in index, or not in book content to the extent one might expect)
- case classes (not in index, and not in evidence in Chapters 4-7 [[*** FACT CHECK****]] )
- Type inference: this is an omission, in that there's discussion of gotchas and workarounds, e.g. p.156, 207, 247, but no background discussion of how scala differs from, say, haskell or ocaml (subtyping changes everything: Hindley-Milner global unification is not possible, so scala does "flow-based" or "localized" inference.
- Reflection and 2.10 macro API: these are not covered, since they were not anywhere near final specification when book was written, but are important topics in "modular abstractions"
Chapters 8-10 (
Collections, Actors and Java Interop) are standalone reading, all full of good info, but not as integrated as chapters 4-7. The Actors chapter covers the 2.8 and 2.9 Scala actors lib, as does the Artima book, rather than the Akka lib that is now the official actor/async/future/promises lib in scala. So the particulars of how to create/link/message actors is different, but the content is good.
akka vs. Erlang OTP
akka has:
- typed channels,
- Apache camel and JMX libs connect to AMQP, rabbitMQ.
- "become" and typed actors that flip between states vs. erlang's selective message receives
BTW, read the blog (
http://letitcrash.com/), what do you see? Very simple type signatures!
Chapter 11: "Patterns in FP" covers:
Category Theory (Functors, applicatives, monads). Monads are a difficult subject to cover in a short text. RWH and Learn You a Haskell: develop the topic over a 100 pages or more, convey what the properties and laws of each structure are, beginning with functors (and including monoids), and do it well.
Many "tutorials" try to invert the intuition. Rather than talking about properties and laws, they make it about a concrete "container, context, programmable semicolon, or guard/test". Which leads to widely lampooned burrito, spacesuit and tutorials where the author doesn't know what functors and applicatives are.
S in Depth avoids this by making statements like "Monads are FlatMap", "
Book's two main Downsides: Index and Copyediting
I have to say it, the index is miserable, which makes it difficult to find anything, which reduces the value of the book, unless you write your own index. Horstmann's index is 22 pages, Staircase 2nd edition has 34 pages; those are well-indexed books. S in Depth is 8 pages, which if spread out to 2 columns/page, equates to 12 pages.
I would've done it like this:
http://www.flickr.com/photos/41758452@N00/sets/72157632325530580/
This book was not professionally proofed/copy edited. There's a fair number of embarassing typo's, like the one in big font on back cover, and mis-spelling Prof. Odersky 's name. In the unicode section around page 50, the typesetter forgot to insert most of the unicode symbols. But those don't matter much, there's other parts where the meaning is obscured.
The "numbered" trait linearization graph on p. 75 has no numbers.