Book review: CoffeeScript Ristretto by Reginald Braithwaite

Book's cover

Five months ago, CoffeeScript was added to my list of day-to-day programming languages when a client decided to use it to build the Node.js backend for a very ambitious cloud platform. The opportunity to learn a language I had heard a lot of interesting things about — like its concise syntax and clear semantics — thrilled me. However, my skills needed to be up to par quickly.

Usually when I find myself in this sort of situation, I prefer to pick up short books that I can read cover to cover in a couple of weeks. For me, a theoritically sound presentation of the basics and a selection of best practices are essential. I usually try to avoid reading books with more than 350 pages other than for references. Once I feel that I’m on the right track, I try to learn by experimenting and reading other seasoned programmers’ code.

Some of Reginald Braithwaite’s work — like JavaScript Allongé and various essays — had caught my attention in the past when I was searching for an advanced JavaScript book. His attention to fundamental programming concepts had greatly impressed me. So when it was time to get started with CoffeeScript, I decided to give his book CoffeeScript Ristretto a try.

My first impressions were not very good. Although the author explicitely warns the reader that the notions presented at the beginning are elementary, the content in the first chapters felt too basic. It is not until the second half of the book that things get more interesting. Basic concepts, like the difference between values and expressions, are discussed at length. While this approach allows for interesting theoritical reflections — like in the section on the tension between encapsulation and extension in object oriented programming — it can sometimes get very boring if the matter is already known to the reader. The author seemed to target absolute beginners and advanced programmers at once.

Sometimes the writing style felt too verbose or almost pedantic. Yet at other times, the theoritical rigor mixed with a strong sense of humour could be refreshing. There’s even a reference to the Monty Python’s sketch on arguments.

Example code was almost always very academic and sometimes a bit convoluted. A better balance between practical and theoritical examples would have been welcomed. This is not a major issue in itself, but it made the text tedious or more difficult to read, especially near the end when concepts are more advanced.

Fortunately, illustrations related to coffee (the beverage, not the language) provided for a welcome breath of fresh air between the dense sections. However, the book generally lacked diagrams, especially when describing certain concepts that could easily be represented graphically, such as closures. The order of chapters was also surprising sometimes; I still wonder why he only explains how to run examples at the end of the book.

Despite all these shortcomings, I really enjoyed this book. The second half contains one of the best presentations on object oriented programming in JavaScript that I’ve ever read. Other fundamental computer science topics like dynamic and functional programming are also well illustrated with CoffeeScript. Interesting digressions that mention concepts from advanced or lesser known mathematic and computer science concepts — for example fixed point combinators — are also a welcomed addition. More generally, this book is comprised of solid text that enables you to better understand certain core programming concepts. I know that I will refer back to it more than once.

This may not be the best edited book or the quickest way to learn about the key characteristics of CoffeeScript. However, some advanced JavaScript concepts, such as prototypal object oriented programming, are very well presented. With an elevated level of theory and interesting digressions, CoffeeScript Ristretto´s enlightning text will benefit any programmer leaving him or her thinking about numerous compelling programming concepts long after finishing the book.

Looking for a tutorial on CoffeeScript, this was not the book I expected to read. Instead I got an inspirational and practical essay on functional and object oriented programming. At 15 dollars, it really is a good bargain.

Julien Gilli 15 October 2013
blog comments powered by Disqus