Saturday, August 09, 2014

Functional Thinking by Neal Ford: Book review

Functional ThinkingFunctional Thinking by Neal Ford
My rating: 4 of 5 stars

Functional programming can often sound like magic, in its promises of greatly improved productivity and near guarantees of accuracy and expressiveness. But one problem is that the examples usually given are those in an unfamiliar form, using languages very different than the procedural and object oriented languages most of us are used to. And the advantages are not apparent when presented. What Ford does in Functional thinking is to present the advantages of functional programming within the context of an object oriented language that can support this, then move to more appropriate languages to show how the advantages can be more clear when the language supports it more directly. It does not stand alone, you will not learn functional programming from this book, but it does offer a more clear argument for why functional programming can useful and better in some circumstances.

The setting that I have seen functional programming explained and taught has always been in the context of demonstrating a functional programming language, such as a Lisp (Lisp, Scheme, Clojure). Or sometimes, a language that has some functional features (R, Python). But I always had to take the commentators word at why this was good. Ford using Java 8 (as it adds some functional features), Groovy, Scala, and Clojure provides a progression from functional features in an object-oriented language (Java), to functional features in multi-paradigm language (Groovy and Scala), to it look in a language that is clearly functional (Clojure). This provides a good look at its qualities by showing how these features improves upon an object-oriented solution, then how it is more expressive and closer to the problem when presented in the cleaner form (i.e. in Groovy, then Clojure). I probably would not have caught the lessons of this if this was my first exposure, and I stopped after the first chapter to watch one of Ford's talks on YouTube so I could get an overview of the book before I finished. But the reward is that it gives context for my learning of Clojure (and functional programming in general).

Not for learning a programming language, but for learning how to think about problems in new ways, enabled by functional programming.

Note: I received a free electronic copy of this for review as part of the O'Reilly Press Blogger program.

View all my reviews I review for the O'Reilly Reader Review Program

No comments: