Elements of Clojure by Zachary Tellman [Leanpub PDF/iPad/Kindle]
Elements of Clojure
Elements of Clojure
Elements of Clojure

This book is 65% complete

Last updated on 2017-06-13

About the Book

This is a work in progress.  There are drafts available for three out of four chapters. The first chapter can be read for free.


This book is named, in part, for Strunk and White's classic Elements of Style.  Like its namesake, it aims to be short, opinionated, and sometimes wrong.  It is intended for readers who are already familiar with Clojure's core concepts, and wish to use them to good effect.  Where possible, this book will give concise, prescriptive advice on how to write idiomatic Clojure. 

However, many aspects of software defy prescriptive advice.  Strunk and White largely concern themselves with the elements of a well-written sentence, but a book is not just a collection of sentences.  The same is true for software; the relationships between the expressions matter as much as the expressions themselves.  This book addresses these aspects by describing the space of possible approaches, and providing a framework for deciding which to use.

While many of the ideas discussed here are applicable to other languages, a focus on Clojure allows for actionable advice.  This book focuses on the JVM implementation of Clojure, for the same reason.  Generalizing the advice given here is left as an exercise for the reader.

The first chapter, Names, explains why names define the structure of our software, and provides tools for judging whether a name is any good.

The second chapter, Idioms, provides specific, syntactic advice for writing Clojure which is clean and readable.

The third chapter, Indirection, looks at how code can be simplified through separation.

The final chapter, Composition, explores how the constituent pieces of our code can be combined into an effective whole.


If you'd like to discuss the book, visit the mailing list.

  • Share this book

About the Author

Zachary Tellman
Zachary Tellman

Zach writes code and sometimes not-code. He is currently working on a tool for exploratory analysis of streaming data. He has approximate knowledge of many things.

The Leanpub Unconditional, No Risk, 100% Happiness Guarantee

Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms

Write and Publish on Leanpub

Authors and publishers use Leanpub to publish amazing in-progress and completed ebooks, just like this one. You can use Leanpub to write, publish and sell your book as well! Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks. Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. It really is that easy.

Learn more about writing on Leanpub