Electronic Design

Programming in Scala: A Comprehensive Step-By-Step Guide

By Martin Odersky, Lex Spoon, and Bill Venners

Scala is a relatively new programming language designed to run atop virtual machines like those used with Java or C#. It is a mixture of many ideas including those tailored for object oriented and functional programming. It incorporates an interactive interpreter and it works equally well as a scripting system and heavy-duty application platform.

The book is written by the language developers allowing them to provide insights into its operation and the reasoning behind its creation.

As with most language overviews, the book starts with a couple introductory chapters that start with examples that are easily tried using the interactive mode. The open source software can be downloaded from www.scala-lang.org.

Most of the remaining chapters are divided up by language features including the type system, inheritance, pattern matching, and actors. The presentation is in a narrative form and designed to run from start to finish although it is easy to drop into any chapter or section when using it as a reference guide.

The authors keep in mind that many readers will already be familiar with Java since this was the initial target platform. The underlying Java system also provides services that are not built into the system, but there is quite a bit in Scala, hence a rather hefty book.

I especially liked the treatment of implementations specific to Scala such as traits, mixins, and actors. These are features that are found in other languages, but Scala implementers did a bit of cherry-picking so Scala has a host of godparents. The book does a good job of covering not only the how but what and why as well. This is important if you expect to get the most out of Scala without a good bit of experimentation and exploration.

The authors assume readers have basic knowledge of Java and running Java applications at the start but later chapters like “Combining Scala and Java” delves into the lower level interface that will be valuable for using Java runtime support from Scala applications.

It definitely helps to have Scala running while reading the book just to check out the examples. As with the transition to object oriented programming, moving to Scala means changing your mindset to take full advantage of the language. This book will make that transition easier.

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish