Buy $14.99
| Digital List Price: | $19.99 |
| Kindle Price: | $14.99 Save $5.00 (25%) |
Rent $7.26
Today through selected date:
Rental price is determined by end date.
- Highlight, take notes, and search in the book
- In this edition, page numbers are just like the physical edition
Your Memberships & Subscriptions
Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required. Learn more
Read instantly on your browser with Kindle for Web.
Using your mobile phone camera - scan the code below and download the Kindle app.
Functional JavaScript: Introducing Functional Programming with Underscore.js 1st Edition, Kindle Edition
| Price | New from | Used from |
|
Paperback, Illustrated
"Please retry" | $16.85 | $1.95 |
- Kindle
$7.26 - $14.99 Read with Our Free App - Paperback
$15.97 - $17.7425 Used from $1.95 21 New from $16.85
How can you overcome JavaScript language oddities and unsafe features? With this book, you’ll learn how to create code that’s beautiful, safe, and simple to understand and test by using JavaScript’s functional programming support. Author Michael Fogus shows you how to apply functional-style concepts with Underscore.js, a JavaScript library that facilitates functional programming techniques. Sample code is available on GitHub at https://github.com/funjs/book-source.
Fogus helps you think in a functional way to help you minimize complexity in the programs you build. If you’re a JavaScript programmer hoping to learn functional programming techniques, or a functional programmer looking to learn JavaScript, this book is the ideal introduction.
- Use applicative programming techniques with first-class functions
- Understand how and why you might leverage variable scoping and closures
- Delve into higher-order functions—and learn how they take other functions as arguments for maximum advantage
- Explore ways to compose new functions from existing functions
- Get around JavaScript’s limitations for using recursive functions
- Reduce, hide, or eliminate the footprint of state change in your programs
- Practice flow-based programming with chains and functional pipelines
- Discover how to code without using classes
- ISBN-109781449360764
- ISBN-13978-1449360726
- Edition1st
- PublisherO'Reilly Media
- Publication dateJune 1, 2013
- LanguageEnglish
- File size3943 KB
Customers who viewed this item also viewed
Editorial Reviews
About the Author
Michael Fogus is software developer with experience in distributedsimulation, machine vision, and expert systems construction. He's actively involved in the Clojure and Scala communities.
--This text refers to an alternate kindle_edition edition.Product details
- ASIN : B00D624AQO
- Publisher : O'Reilly Media; 1st edition (June 1, 2013)
- Publication date : June 1, 2013
- Language : English
- File size : 3943 KB
- Simultaneous device usage : Unlimited
- Text-to-Speech : Enabled
- Screen Reader : Supported
- Enhanced typesetting : Enabled
- X-Ray : Not Enabled
- Word Wise : Not Enabled
- Sticky notes : On Kindle Scribe
- Print length : 262 pages
- Best Sellers Rank: #1,563,718 in Kindle Store (See Top 100 in Kindle Store)
- #438 in JavaScript Programming (Kindle Store)
- #774 in Web Programming
- #977 in JavaScript Programming (Books)
- Customer Reviews:
About the author

A programmer in the DC area specializing in artificial intelligence, code generation, and distributed simulation.
Customer reviews
Customer Reviews, including Product Star Ratings help customers to learn more about the product and decide whether it is the right product for them.
To calculate the overall star rating and percentage breakdown by star, we don’t use a simple average. Instead, our system considers things like how recent a review is and if the reviewer bought the item on Amazon. It also analyzed reviews to verify trustworthiness.
Learn more how customers reviews work on Amazon-
Top reviews
Top reviews from the United States
There was a problem filtering reviews right now. Please try again later.
I don't agree with some of the commentary, particularly many of the statements made about Object Oriented Programming as there's seems to be a lesser degree of knowledge of it based on the comments made. For example OOP has patterns, which just work. Those patterns came about by continual refactoring to get to the point where all code becomes a container for very low level generic functional programming styles. In that sense, there is virtually no difference between Functional Programming and OOP. Experienced OOP folks are already reducing code at it's lowest layer to functions that support dependency injection. They can, if wanted return functions to functions too.. JavaScript is not a magic bullet, rather it's a ubiquitous language that is fun and cool.
Michal is not a "Funtionista" but there are many of them out there bashing OOP by saying things like "OOP is the result of a bad programming language", while that may have been true in 1985, it's simply a joke to believe that's true any longer.
Thanks Michael for the superb job.
This is not an easy book.... you must already have a good level of programming and javascript. If this is your first functional programming book, and you are not already an experienced developer you will suffer.
There are today more pedagogic, modern alternatives to this book.
Actually I find I understand better all the topics presented by reading focused, recent blog posts !!
Still I don't regret purchasing and reading this book as it presents a good overview about what you need to know to program functionally.
the material is there but i think it would be a lot clearer and less arduous if it just got straight to the point.
Michael Fogus uses the excellent UnderScore.js library by Jeremy Ashkenas, to teach functional programming using JavaScript. The power of functional programming is too great to ignore. This book eases some pain in terms of building up step by step examples that illustrate functional programming thought process.
Though the first 3 chapters were relatively easy to understand the later chapters do get a bit complex. I intend to re-read this book, while working out code samples, for better understanding.
One note - keep the Underscore.js docs handy, as the author makes extensive use of underscore.js without a lot of detail on how the functions work.
Top reviews from other countries
It also gives a good introduction to the Underscore library, which I have used for a few years and now feels very much like the missing part of the language for me.
If you are an experienced programmer who wants to improve your JavaScript this is well worth a read, particularly if you come from a more object-oriented background in a language like C# or Java and you find yourself spending more time than you would like trying to understand what "this" refers to at any given point, this will really help.
An ideal follow-up to "The Good Parts" in any JavaScript programmer's education.
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.
To save himself developing a suite of boilerplate to underpin his functional style, Fogus uses the well-known Underscore library; initially to draw some of his early examples from real life usage, and subsequently as a background framework for the whole book. (You may, like me, prefer the alternative LoDash implementation of the same interface, which will disadvantage you not at all as far as this book is concerned.) However, the book is not about Underscore, and the author only uses it as a background to his main aims. Indeed, the code throughout is general-purpose and environment-independent; not tied to, for example, web browser programming or a Node-madic existence.
There are a lot of good things to say about this book. One thing is that it is, in places, quite dense, but somehow sustains the illusion that it is an light read (I also found this with Crockford's JavaScript: The Good Parts). It is quite easy to sail through chapters and suddenly realise that one has no clue about how a fragment of code works, and discover the need to backtrack a page or two and try again, with concentration turned up a couple of notches. This may sound like a criticism, but really it isn't: books that flatter and tempt the reader into wading out beyond his depth without realising it are actually the books that, in the end, create new swimmers. It is the one that bore you rigid that should be avoided.
Fogus's prose style is fairly light and entertaining - he know to put in some jokes without steaming up the lens with excessive humour. His ambition is admirable: these are quite complex techniques that are worth understanding: one can sense his enthusiasm and his desire to put things across. He has a good eye for a bit of code that demonstrates an idea in short form without being unbearably patronising. He occasionally pursues his red herrings a bit far, or attempts a line of discussion which doesn't really help much: I'd put the long discussion of scoping at the start of chapter 3 in this category. But much more hit than miss.
Also, Fogus is not above letting the boys have their toys. JavaScript notoriously can't optimise tail-recursion, so here is a coded up work-around that is fun to implement and will blow the heap before it blows the stack. Possibly not particularly practical, but hey! JavaScript can do it, dude.
There is 'but' that is implied by the missing star: I think the author has really been let down by his O'Reilly editor and his proofreaders. The first thing to do on getting hold of this book (in paper form) is to google up its errata website and ink in all the corrections. Really. Some of the proofing errors are doozies, if you take the book seriously you'll have enough on your plate following its thread without refinding what others have already flagged.
Once you have done this, don't put your red pen away. Fogus has the habit of supplying a function once and then referring to in code several chapters later. For example, construct() is a one line function introduced without any particular emphasis on page 39 in Chapter 2; when it resurfaced on page 116 Chapter 6 I had entirely forgotten it, and it is not in the index. This happens quite a lot, and it can be a sod to track the original down. Another irritating systematic failure: Fogus inserts his references in the academic style '(Touretzky 1990)', but his bibliography lists his sources by title, ordered by the order they happen to be on his bookshelf - making the references tedious to resolve. Apart from this sort of thing, minor typos litter the book, but that perhaps infuriates only sad obsessives like myself. But from O'Reilly, I expect more.
Otherwise: yeah, go for it.




