Wednesday, July 17, 2013

"Functional Javascript" by Michael Fogus; O'Reilly Media;

In his new book, Fogus attempts the twofold task of introducing his audience to functional programming in general, and demonstrating how one can achieve a functional style using Javascript and the underscore.js library in particular.

Reading this book was my first sustained investigation into functional programming proper. I had heard it mentioned in various contexts through the years, but as far as real reading into the topic, I doubt that I had done more than simply skimmed the functional programming wikipedia page.

I had, naively, expected to be faced with something entirely foreign when I initially opened the book. What I found, though, is probably best compared to the first time you listen to jazz music after years of listening to rock. All the parts are the same, the musicians use the same instruments, making the same sounds, but use them in ways that are both familiar but, in some sense, radically different at the same time.
In terms of example code provided, it will be comprehensible to anyone familiar with plain old imperative javascript coding, one might simply be struck by the way things are done. They may seem unnatural at first, but once one starts to get a feeling for the functional style it becomes clear how functional programming makes it easier to reason clearly about your code, something that (it is obvious to me now) is much more difficult in the good old fashioned OOP or imperative programming paradigms.

I have no gripes about the book, I picked up a few minor typos - these are to be expected in a first printing, and have all seemed to already been reported. All in all I think it's a fantastic addition to the JS literature and should be read by any JS programmer who is serious about writing extensible, scalable code.

I see myself returning to this book again and again - I can think of no higher compliment for technical writing.

You can purchase the book directly from O'Reilly at the "Functional Javascript" product page and support DRM free publishing.

  I review for the O'Reilly Blogger Review Program

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.