The Clean Code Blog

by Robert C. Martin (Uncle Bob)

Functional Programming for the Object Oriented Programmer

24 August 2012

This book, written by Brian Marick, is important. Indeed, it may be necessary. We need something to bridge the gap between the huge population of OO programmers, and the growing need for functional programmers. I’ve seen nothing else that fills this need so well.

I read a lot of books, but few are so competently written. I’m a hundred pages in and I’m loving it. If you are a Java, C#, C++, Ruby, or Python programmer, and you are wondering what all this functional programming noise is about, this is the book for you.

First, the book is a pleasure to read. Marick’s style is witty, wry, informal and, best of all, terse. His code examples are straightforward and well conceived. He makes his points quickly, and then he gets on with the next topic. There’s no dawdling. He respects his reader by unapologetically covering a lot of ground in a short time. He provides a few salient exercises at the end of each chapter, and then moves right on. The book is a challenging read; but not a challenge to read.

The title says it all; and the pedagogical approach is ingenious. What better way to explain and expose functional programming to an OO programmer than to build an object system in a functional language? And what better language to build such an object system than Clojure? Not only will you learn a lot about functional programming in terms that make it easy to understand; you’ll also learn a lot about OO that you may not have known before.

Marick realized that most of his readers won’t know a functional language. So he chose the simplest one to learn. He also realized that teaching the language would distract from the purpose of the book. So he strikes a brilliant compromise: He presents the barest minimum of the language he can get by with, and then gets right on with the business of describing functional programming. The technique is very effective; though many Clojure programmers will find the language primitives he constrains himself to a wee bit frustrating.

Is there anything bad about the book? Yes; It’s not done. Marick published it on Leanpub.com and has been writing chapters over the last many months. Since the book isn’t really finished, there are a few typos here and there; and there’s a sense of a ragged end where unwritten pieces may be needed to fill some gaps. But I haven’t found this to be at all distracting so far.

My recommendation is to buy this book now. You can get it here. There’s a slider that allows you to choose the price you want to pay for the book. You should slide it all the way over to the right, like I did, and pay the $30 – it’s more than worth it.