Books

Books : reviews

Cay S. Horstmann.
Scala for the Impatient.
Addison-Wesley. 2012

rating : 2.5 : great stuff
review : 11 August 2014

Scala is a modern programming language for the Java Virtual Machine (JVM) that combines the best features of object-oriented and functional programming languages. Using Scala, you can write programs more concisely than in Java, as well as leverage the full power of concurrency. Since Scala runs on the JVM, it can access any Java library and is interoperable with Java frameworks.

Scala for the Impatient concisely shows developers what Scala can do and how to do it. In this book, Cay Horstmann, the principal author of the international best-selling Core Java™, offers a rapid, code-based introduction that’s completely practical. Horstmann introduces Scala concepts and techniques in “blog-sized” chunks that you can quickly master and apply. Hands-on activities guide you through well-defined stages of competency, from basic to expert. Coverage includes

  • Getting started quickly with Scala’s interpreter, syntax, tools, and unique idioms
  • Mastering core language features: functions, arrays, maps, tuples, packages, imports, exception handling, and more
  • Becoming familiar with object-oriented programming in Scala: classes, inheritance, and traits
  • Using Scala for real-world programming tasks: working with files, regular expressions, and XML
  • Working with higher-order functions and the powerful Scala collections library
  • Leveraging Scala’s powerful pattern matching and case classes
  • Creating concurrent programs with Scala actors
  • Implementing domain-specific languages
  • Understanding the Scala type system
  • Applying advanced “power tools” such as annotations, implicits, and delimited continuations

Scala is rapidly reaching a tipping point that will reshape the experience of programming. This book will help object-oriented programmers build on their existing skills, allowing them to immediately construct useful applications as they gradually master advanced programming techniques.

Python is my current language of choice, but when you are writing something more substantial, having a strongly-typed language helps. One of my colleagues has been enthusing about Scala in general, and this book in particular, so I thought I’d give it a look.

Being not just the impatient of the title, but very impatient, I have frankly skim-read much of the book. Nevertheless, I’m impressed by what I’ve seem, both of the language, and its presentation here. Scala seems to be a well designed and interesting modern language, with many sophisticated and powerful features, but with no burdensome syntactic overheads.

The back-cover blurb (above) offers a good summary of the key features described in the book. Scala compiles down to run on the JVM; it is object-oriented with functional capabilities; it allows mixin-style traits that can contain implementation code; it has support for parsing in general and XML in particular; it has extra support for concurrency through actors (thread-safe concurrent objects); and it has support for continuation programming (proceed with caution!)

The concise and focussed style of the book allows a brisk trot through many language features, whilst still containing a lot of technical meat, all introduced through code snippets. It does assume some knowledge of Java, as several of the examples contrast it with that earlier language.

A good technical read, making me want to try out the language, particularly the actors for complex systems simulations.