Book Reviews

Practical Clojure by Luke VanderHart and Stuart Sierra

ISBN: 978-1430272311
Publisher: Apress
Pages: 232

A year ago I read Stuart Halloway's Programming Clojure . Stuart's book is a solid introduction to the language. I expected Practical Clojure to complement it, explore the language in more depth and at a larger scale. The title obligates. I remember my first pass through Peter Seibel's Practical Common Lisp five years ago. The very first sentence breathed excitement, promising to change the way the reader looks at programming. As I got to chapter 3, the first practical chapter, I understood what makes Lisp different and why I want to use it. The rest of the book delivered to its promise, illustrating how to solve non-trivial problems in an expressive and elegant way through the unprecedented power of Lisp. I expected Practical Clojure to follow that style and do the same for Clojure as Peter did for Common Lisp. I was in for a hard disappointment.

Let me start with what this book isn't. Despite its title, there's nothing practical about it. No code samples beyond the usual toy-programs like an incomplete bank account example, no examples on large-scale programs and no discussions of libraries. Given the authors contributions to Clojure , this is quite surprising. For example, Sierra's JSON parser/generator and duck-streams would provide excellent case studies to show the power of Clojure. To me, that's a missed opportunity and I simply don't see the purpose of Practical Clojure. The book is written like an augmented reference manual, providing little insights beyond what's available in the online reference . There are plenty of code samples, but most of them are simple REPL exercises. Worse, some of the more interesting parts of Clojure, the features that really put it ahead of other languages, get a sparse treatment. The text itself is quite good, but once again, the code samples detracts from the value. To give some examples, consider the chapter on parallel programming. Instead of taking a real problem and demonstrate Clojure's elegance, a bunch of functions that do nothing more than a sleep are executed concurrently. The chapter on meta programming feels equally thin. Where Peter Seibel walked us through the construction of a complete parser for binary files and a framework for web-applications, Practical Clojure presents an incomplete XML generator. It's disappointing and I do think the authors could have done better.

I've been quite negative in my reception of Practical Clojure. It's not that it is a particularly bad book . It isn't. It's just that I cannot see the need it fills, its raison d'etre. Given Clojure's rising popularity, I do believe there's such a need for a real practical book about Clojure. A book that focuses on solving realistic real-world problems. Clojure is such an exciting and innovative addition to the Lisp language family and it deserves a really good introduction. Until that book is written, I recommend the online documentation combined with Halloway's book.

Reviewed July 2010