Computing Reviews

Programming in Scala :a comprehensive step-by-step guide
Odersky M., Spoon L., Venners B., Artima Incorporation,Mountain View, CA,2008. 776 pp.Type:Book
Date Reviewed: 01/06/10

Although writing a graphical user interface (GUI) spreadsheet application in 200 lines of code is certainly a tall order, this is exactly the example provided in the last chapter of this book.

Many of Scala’s features are described in the book, including the integration of functional and object-oriented programming; an advanced type system that allows for the enhancement of built-in types through traits; pattern-matching combinators; and a powerful event-handling abstraction. Of course, this is not a comprehensive list of Scala’s strengths; in the new world of multicore processors, it provides a robust foundation for concurrent programming, by supporting immutable value types and adopting Erlang’s actor mechanism. Scala also aids developers who rely on application programming interfaces (APIs), by making the corresponding code appear as a domain-specific language. Scala’s type system also helps in this regard, by inferring types in the API client code, thereby reducing the verbosity associated with static typing. Furthermore, the type system promotes code robustness by handling null-like results. A carefully constructed class hierarchy gives all elements an object-like appearance, without sacrificing efficiency. Other powerful features of Scala that are explained in the book’s 33 chapters include partially applied functions, lazy evaluation, nested packages, singleton objects, case classes, and native Extensible Markup Language (XML) support.

As one can infer from the description above, Scala is a large and complex language. Although it is compatible with Java’s ecosystem, Java programmers will have scores of new concepts to master, with the functional programming style being the most difficult and rewarding element. The larger examples included in the book effectively demonstrate the language’s power, as well as the appropriate design and implementation techniques.

Books that introduce a new programming language are in the unenviable position of being compared with Kernighan and Ritchie’s classic work [1]. When compared to this exacting standard, the book has room for improvement. A machete-wielding editor could create a superior second edition by cutting back on comparisons with Java, implementation details, advocacy, footnotes, and the many examples of errors and suboptimal alternatives. Ideally, such an edition would also allow mere mortals to understand the language’s more esoteric features, such as variance annotations and abstract members. In its current form, the book can admirably serve programmers, as it is a detailed and complete guide to an exciting new language.


1)

Kernighan, B.W.; Ritchie, D.M. The C programming language (2nd ed.). Prentice Hall, Englewood Cliffs, NJ, 1988.

Reviewer:  D. Spinellis Review #: CR137614 (1012-1204)

Reproduction in whole or in part without permission is prohibited.   Copyright 2024 ComputingReviews.com™
Terms of Use
| Privacy Policy