Functional Thinking: Paradigm Over Syntax

Author: Neal Ford
Publisher: O'Reilly
Pages: 180
ISBN: 9781449365516
Print: 1449365515
Kindle: B00LEX6SP8

Audience: Devs who already know some functional programming
Rating: 2
Reviewer: Alex Armstrong 

Functional programming is a hot topic and a book that helps you think like a functional programmer is a great idea. 

However this all depends on the author being able to think like a functional programmer and being able to express those thoughts. This is a tough requirement.

This particular book is based around Java, Scala, Clojure and the JVM functional languages. It is aimed at a reader who already knows the basics of functional programming and wants to know more. The use of Java and Scala is justifiable in that they are both popular languages, but the key task is to use them to illustrate function programming ideas so that the book might be useful to the more general reader. 

 

Banner

 

Although the book states that it is aimed at readers who know some functional programming, it isn't very clear exactly what they are expected to know. There are various grades of "knowing" functional programming from just stringing together some fluent function calls, to using lambdas and worrying about monads. This book isn't at the academic end of the spectrum and it doesn't go in for functional programming as typified by Haskell and its practitioners - you won't find any references to category theory or even the ever-trendy monads. Unfortunately you won't find much in the way of references to what makes functional programming special - pure functions and what this means in practice, i.e. immutability and minimal side effects. These core aspects of functional programming are not emphasised and are certainly not presented as motivating factors for adopting functional programming. 

The first chapter is an introduction to the idea of functional programming but it isn't very convincing. Neal Ford introduces the idea of ceding control to the language/runtime - which is a programming trend but not one particularly associated with functional programing. Here we first start to get a flavor of the approach - a description of basic things rolled up into management speak slogans with little effective proof or indication of why things might be better.

Chapter 2 moves on to consider imperative versus functional programming and really doesn't explain the difference. An example of using standard functions such as filter, map and fold/reduce follows. You can use these without swallowing the whole functional idea and this is a very weak form of functional programming. 

Next we have a chapter entitled "Cede". This book really does try to persuade you of the idea that functional programming is mostly about letting the language look after things that you would normally worry about. This is true for programming in general and no more so for the functional approach. Next we get an explanation of closures, Currying, partial application and recursion - none of which made any sense to me and I know what they all are. The explanation of the difference between Currying and partial application was particularly dense and left me wondering why a simpler example was used. The same is almost true of closure and there is very little explanation of how or why any of this might be useful. In particular recursion is just introduced as an alternative form of iteration - it is in fact iteration with a variable number of indexes. 

 

 

Chapter 4  is called Smarter Not Harder and again we have an aphorism that applies to just about any approach to programming. In this case the topics are memoization and lazy evaluation. Again all simple ideas introduced in complicated ways with lots of cute quotes.

At this point I had lost patience with the book and almost gave up on it. Chapter 5 is called Evolve and its about some strange topics that are examples of "bending" the language toward the problem - functional polymorphism (i.e. multi-dispatch), operator overloading and functional error handling. Chapter 6 is about functional patterns, Chapter 7 is about Java 8 and the final chapter is about polyglot and polyparadigm programming. 

There might be something worthwhile in these chapters. but it would be hard work digging it out. Much of the book seems to be about showing programmers familiar with object-oriented techniques and the "patterns" approach to programming how functional programming can be seen in a similar way.  

This book is full of cute sounding quotes, the sort beloved of management, confusing explanations and very little about functional thinking beyond the surface details of the languages used as examples. You might get something out the comparison of the different JVM languages and how they approach functional programming, but only if you already know what functional programming is all about at a reasonably deep level.

 If you are serious about appreciating functional programming then you need to look for a different book.

 

Banner
 


Software Architecture In Practice

Author: Len Bass, Dr. Paul Clements and Rick Kazman
Publisher: Addison-Wesley Professional
Pages: 464
ISBN: 978-0136886099
Print: 0136886094
Kindle: B094CPJ96B
Audience: Software architects
Rating: 4.5
Reviewer: Kay Ewbank

This is the fourth edition of a book widely regarded as a classic since its firs [ ... ]



Fundamentals of Database Management Systems

Author: Dr. Mark L. Gillenson
Publisher: Wiley
Pages: 416
ISBN:978-1119907466
Print:1119907462
Audience: Database managers
Rating: 3
Reviewer: Kay Ewbank

This book is aimed at people taking a one-semester course in database management as part of their larger information systems management course. As suc [ ... ]


More Reviews

 

 

Last Updated ( Sunday, 16 November 2014 )