A Practical Guide to Better, Cleaner Code with Functional Programming In Functional Design , renowned software engineer Robert C. Martin ("Uncle Bob") explains how and why to use functional programming to build better systems for real customers. Martin compares conventional object-oriented coding structures in Java to those enabled by functional languages, identifies the best roles for each, and shows how to build better systems by judiciously using them in context. Martin's approach is pragmatic, minimizing theory in favor of "in the-trenches" problem-solving. Through accessible examples, working developers will discover how the easy-to-learn, semantically rich Clojure language can help them improve code cleanliness, design, discipline, and outcomes. Martin examines well-known SOLID principles and Gang of Four Design Patterns from a functional perspective, revealing why patterns remain extremely valuable to functional programmers, and how to use them to achieve superior results. "Functional Design exudes 'classic-on-arrival'. Bob pulls back the curtain to reveal how functional programming elements make software design simple yet pragmatic. He does so without alienating experienced object-oriented programmers coming from languages like C#, C++, or Java." --Janet A. Carr, Independent Clojure Consultant Register your book for convenient access to downloads, updates, and/or corrections as they become available. See inside book for details.
Robert Cecil Martin, commonly called Uncle Bob, is a software engineer, advocate of Agile development methods, and President of Object Mentor Inc. Martin and his team of software consultants use Object-Oriented Design, Patterns, UML, Agile Methodologies, and eXtreme Programming with worldwide clients.
He was Editor in Chief of the C++ Report from 1996 to 1999. He is a featured speaker at international conferences and trade shows.
A good overview of pragmatic functional programming. Uncle Bob delivers a very realistic perspective on a sensationalized programming paradigm. His prose is backed by whole, detailed case studies demonstrating his approach to Functional design (with a capital "F"). The book is introductory, however, in broad strokes. There is no mention of nomenclature commonly associated with FP--monoids, monads, category theory and the like.
I received an early draft of this book in order to do a technical review for the publisher, so my review is based on that read-through.
I was curious to see how well it would work with all the example code being in Clojure. I've gone through two or three iterations of learning Clojure, but it's a long time ago, and I'd forgotten most of it again. Clojure isn't really my kind of language - not because of its Lisp syntax (which, in fact, is fascinating), but rather because it's dynamically typed. After running into too many exceptions that could have been a type error, I gave up on the language.
But I digress.
The book doesn't assume that you know Clojure, and it does a fine job teaching you to read it as it progresses. I had no problems following the examples or the explanations.
It then goes on to take you through a series of examples that describe various aspects of functional programming, as it's done in Clojure.
While I did have quite a few corrections and comments to the manuscript, I read through it in three days. As other Robert C. Martin books, it's quite readable.
My main gripe with the book is the title. I think it's a bit of a stretch to call it Functional Design. A more appropriate name would be Robert C. Martin's Adventures in Clojure.
If you're interested in a lucid and readable exploration of the Clojure flavour of functional programming, then you could do worse than this book.
At first I was really disappointed and really angry that the author forces the reader to learn a new programming language (Clojure) to get the most out of this book. Then I realised - it's the author's choice and I can only thank him for the material. As the anger dissipated, I started to pay much more attention to the ideas expressed, even though I don't know the language and I'm not going to learn it. The sequence of thought, if you try to catch it, is quite valuable. It gives a lot to a thoughtful person. Believe me, even if you don't know Clojure, the book itself will make you think a lot about software design and about combining OO and functional approaches in a single product you make.