The Secret of Functional Programming in JavaScript

 : 454 words

I just finished an amazing book by Luis Atencio named Functional Programming in JavaScript. It is published by Manning and you can purchase it from Manning.

If you have been reading my blog you will see that I have been trying to push myself further into the functional paradigm. I have been classically trained as an object oriented programmer, much like most of the programming world. The idea of functional programming initially just seemed weird and something that people talked about, but never really implemented. Although I was drawn to the compactness of code and ease in which someone can reason about what is happening.

I purchased this book as a MEAP (Manning Early Access Program). MEAP means I received the eBooks as they were written, but I have found it is difficult to finish technical books in a digital format. I still prefer the physical book. The book has been out since the summer, but I have just now finished it. I highly recommend it to anyone wanting to learn more about functional programming.

The book starts off with the common cases for why use functional programming. It is similar to all the other articles on this subject. I would not count that has a detraction as Luis makes a good case for why functional programming.

Next, the book really becomes great in the next part, Get Functional. It takes a simple problem and shows the difference between building an imperative version and a functional version. This part finishes with one of the best descriptions of a monad I have ever read. Monads are one of those things that there are a lot of poor explanations of out on the Internet. I may one day add to that pile. There is a wonderful Douglas Crockford quote about monads.

In addition to it being useful, it is also cursed and the curse of the monad is that once you get the epiphany, once you understand – “oh that’s what it is” – you lose the ability to explain it to anybody.
Douglas Crockford

Luis, though, does not fall to this curse and nails both theory and application.

The final part of the book deals with performance and functional reactive programming. The book notes, correctly, that the value of using functional programming is not in any performance gained, but in writing clean easy to understand code. I feel Luis does a good job of wrapping up the core concept of the book and leaving the reader with somewhere to go.

I currently have my next book already purchased and sitting on my desk, Functional Reactive Programming from Manning. This is directly related as it is one of the books recommended in Functional Programming in JavaScript.

comments powered by Disqus