Channels ▼
RSS

Design

Jolt Awards: The Best Books


Jolt Finalist: The Joy of Clojure: Thinking the Clojure Way, by Michael Fogus and Chris Houser

I consider myself more of a Scala person than a Clojure person, but this book persuaded me to become an even bigger fan of Clojure, the new Lisp-like language that runs on the JVM. Authors Michael Fogus and Chris Houser, both contributing members to the Clojure language project, have crafted a Clojure book unlike any other Clojure title I have read. Rather than pursue the plain path of a language reference, The Joy of Clojure examines the language from a deeper perspective. As such, it expands the reader's thinking with the possibilities (and some limitations) that the current 1.2 release has to offer.

The book is delivered in five parts. The first, Foundations, covers the Clojure philosophy and sets the stage of the tone and topics to come. The basic constructs like scalars, collections, functions, vars, loops, blocks, quoting, exceptions, and namespaces are also discussed. Part II, Data Types, goes deeper into understanding how to best utilize scalars and composite data types in Clojure by considering symbolic resolution, regular expressions, persistence, complexity, queues, and sequential evaluations. Part III explores the hot topic of functional programming, a category that Clojure excels and made its name in. While only two chapters long, the working lazy quick sort and pathfinding examples do the job of showcasing Clojure's power in the functional programming space.

Part IV features another top strength of Clojure: large-scale design. This scaling need is truly why languages like Scala and Clojure exist, and the authors do an excellent job of distilling their knowledge of the subject into four chapters. This section is also the heart of the book and covers the use of macros to control, combine and change forms and manage resources, using the "Universal Design Pattern" with Clojure's multimethods and the Java-Clojure. Chapter 11 on Mutation is a must-read, filled with best practices on the use of agents, atoms, futures, locks, promises, refs, vars and dynamic binding. There's a lot to digest in this chapter and will prove invaluable toward advancing your Clojure experience.

The last part of the book, titled Tangential Considerations, contains chapters on performance issues (type hints, transients, chunking, memoization, and coercion) and a final catch-all chapter on the design considerations behind DSL's, testing, design patterns, error handling, and debugging. It's hard to believe that Fogus and Houser were able to pack so much excellent advice into a 350+ page book.

Readers unfamiliar with the mechanics of the language should first read the other basic tutorial Clojure books on the market, play with the language, and port a few simple programs to it before checking out this book. And while the book's Web page assures that no Lisp experience is necessary, I disagree. Readers who will get the most out of the book and Clojure itself need to have some awareness of Lisp due to Clojure's reliance on that language's main principles. So while it may not be necessary to have Lisp experience, the philosophy and principles expounded upon in The Joy of Clojure will take Lisp (and other functional programming-aware developers) readers further and resonate more deeply with this background experience at the ready.

Additionally, while the book can certainly provide insights to the first-time Clojure student, it will be best appreciated by those who have gained some appreciation for (and frustration with) using the language. It is a book crafted for intermediate Clojure developers seeking to hone their skills and reveal the more graceful subtleties the language has to offer. So while I am still likely to remain a Scala user by day, reading this book has made me a Clojure convert by night.

— Mike Riley


Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.
 

Video