Customer Reviews


1 Review
5 star:
 (1)
4 star:    (0)
3 star:    (0)
2 star:    (0)
1 star:    (0)
 
 
 
 
 
Average Customer Review
Share your thoughts with other customers
Create your own review
 
 
Most Helpful First | Newest First

5 of 5 people found the following review helpful
5.0 out of 5 stars Worth reading if you use Javascript, 26 Oct 2013
Verified Purchase(What is this?)
This book certainly isn't perfect. There are several minor errors in the printed code and output examples, so you probably want a good enough understanding of Javascript to be able to pick them out. Towards the beginning I found it would ramble in places and lead off on some odd tangents. Also, some of the examples comparing functional to imperative code seemed to unfairly attribute good programming practices to functional style. Examples include: returning early and avoiding the use of superfluous variables. Despite a few minor issues I still rate this book highly as I learnt lots of new and interesting things from it.

Underscore provides a set of useful functions that allow you to write shorter, more expressive code. If you are familiar with the ECMA5 array methods map, reduce and filter then you can expect browser independent implementations of those along with a load of additional utility method that can help simplify data transformations. If that is all new to you it may be worth having a play around with them before taking a look at the Underscore site.

Some of the content in the middle of the book repeats some of the stuff I have read in other Javascript books, such as The Good Parts, Javascript Patterns and Effective Javascript, but here the author does a better job of showing practical uses for functional style and explains what aspects of functional programming Javascript is best suited to. Up until now I hadn't really understood why i would want to use currying. It usually gets presented in its arbitrary length form as something you can do, but without reason as to why. Learning about partial application was one of the most fun bits, it allows you to write programs in a very different form. You may need to try applying the code in a practical context to fully realise the benefits, for me they were not always immediately apparent from reading the examples in the book alone.

There is a section on mutability that shows to good effect how referential transparency can help reduce bugs in code, but some of the other techniques for dealing with the mutability of Javascript objects seemed like nasty hacks battling with the language. Another good chapter explains chaining, lazy chaining deferred objects and pipelines. Deferred object are featured in many libraries, but in my experience were not always all that well documented. I can certainly see myself using pipelines in the future too.

At the end of the day, even if you are not particularly interested in functional programming, if you work with Javascript it's worth learning since most libraries have at least some functional aspects, plus you'll probably gain some appreciation for it along the way.
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


Most Helpful First | Newest First

This product

Only search this product's reviews