Computering can be difficult. Our minds don’t naturally work in the way programming languages prefer. This is especially true when changing paradigms, such as from imperative or object-oriented programming to functional programming. The best medicine for this difficulty is a guide, mentor, and friend to help you through the rough spots, to make things understandable and relatable.
With ‘Getting Clojure’, Russ Olsen becomes that friend. He engages with a wry humor and conversational tone, pulling them effortlessly from topic to topic. In place of dry facts and bare, thin syntax, he provides just enough context to understand the why as well as the how, while helpfully pointing out the tripwires and bear traps on each topic. If you have been wishing for a smooth transition into Clojure, this book should be your first choice.
The details:
The book builds content in exactly the order you’re likely to fall down, except for state and mutability. Most imperative programmers are going to bump their face on the topic of mutability/state way earlier than it’s addressed in the book, for two reasons: first, we tend to build toward statefulness much too early. Second, Clojure’s language choices discourage its widespread use. In a functional style, mutable state goes in as late as possible. Don’t fret—if you’re reading and start wondering where you can stick your changes, skip ahead and read the ‘State’ chapter, then come back to where you left off.
The topics list, starting with the ‘basics’ section: capturing and organizing data, making decisions and controlling flow, functions and functional flexibility, scopes from local to global. On to intermediate content: sequencing and laziness, firmer and definable data structures, testing and specification. Finally, the grab bag of advanced topics: java interop, concurrency, state/consistency within mutation, and finally, macros. The first two sections build nicely. At some point, as an author you have to decide which advanced topics you’re going to take on—Olsen makes good choices here.
Finally:
It’s an enjoyable read. If it had been available when I was trying to learn Clojure, I wouldn’t have done so in fits and starts, with much frustration. It’s just enough information, in good order, and never boring. While learning a new language is never easy, Getting Clojure gives you a friendly native guide.