Functional JavaScript
Introducing Functional Programming with Underscore.js
Publisher: O'Reilly Media
Released: June 2013
Pages: 260

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
Table of Contents
Product Details
About the Author
Colophon
Recommended for You
Customer Reviews

REVIEW SNAPSHOT®

by PowerReviews
oreillyFunctional JavaScript
 
4.5

(based on 8 reviews)

Ratings Distribution

  • 5 Stars

     

    (4)

  • 4 Stars

     

    (4)

  • 3 Stars

     

    (0)

  • 2 Stars

     

    (0)

  • 1 Stars

     

    (0)

100%

of respondents would recommend this to a friend.

Pros

  • Accurate (6)
  • Helpful examples (6)
  • Well-written (6)
  • Easy to understand (4)
  • Concise (3)

Cons

    Best Uses

    • Intermediate (7)
    • Expert (4)
    • Student (3)
      • Reviewer Profile:
      • Developer (8)

    Reviewed by 8 customers

    Sort by

    Displaying reviews 1-8

    Back to top

    (2 of 2 customers found this review helpful)

     
    4.0

    Not as expected but still quite good

    By HTML Toronto

    from Toronto

    About Me Designer, Developer, Educator, Maker

    Verified Reviewer

    Pros

    • Accurate
    • Easy to understand
    • Helpful examples
    • Well-written

    Cons

    • Reliance On Underscorejs

    Best Uses

    • Novice
    • Student

    Comments about oreilly Functional JavaScript:

    The book comes off as a love letter to the underscore javascript library at first, even having Jeremy Ashkenas do a forward. While by no means do I think that it is a bad thing to use underscore.js as it provides a much needed extension to Javascript's base functionality, I was hoping for a bit more content on creating function based programming rather than examples of using underscore to extend methods. Even breaking down much of what underscore is and comparing it to native functions.

    After running through the book a few times, I have recommended it to people and have added it to my short list of books to suggest when asked.

    NOTE: This is a review copy of the book I had requested and was not purchased.

    (1 of 2 customers found this review helpful)

     
    4.0

    It's a knowledge enriching book

    By Ish Sookun

    from Mauritius

    About Me Developer, Sys Admin

    Pros

    • Helpful examples
    • Well-written

    Cons

      Best Uses

      • Expert
      • Intermediate
      • Student

      Comments about oreilly Functional JavaScript:

      This book isn't an introductory to JavaScript and the author makes it clear in the beginning. However, the bright side of the book is the availability of source codes on Github. It gives you freedom to play around while reading and thus enriching your knowledge and skills on JavaScript. For those who would like to know what to expect from the book I suggest you check the well-defined book roadmap.

      (1 of 1 customers found this review helpful)

       
      5.0

      JavaScript more functional

      By Przemysław

      from Kraków

      About Me Developer

      Verified Reviewer

      Pros

      • Accurate
      • Concise
      • Easy to understand
      • Helpful examples
      • Well-written

      Cons

        Best Uses

        • Expert
        • Intermediate

        Comments about oreilly Functional JavaScript:

        In introductory chapter author presents functional programming as an assembly line transforming data into final result. In consecutives chapters he shows how to build any particular piece of assembly line: first define some first-class functions, then understand variables scope and closures, then use higher-order functions and finally define function-building functions. It was valuable lesson for me to remind closures, think more about composing functions to solve problems. In chapter about recursion I learned about interesting concept called trampoline - it is a control structure which flattens out recursive calls.

        Book is well written with good sense of humour. There are many examples, author clearly explains them and his motivation why he tackled problem in specific way. Functional JavaScript is nice mindshift and exploration into functional world when reader can write software with elegant API using functional approach.

        (3 of 4 customers found this review helpful)

         
        5.0

        Perfect deep dive into functional JS

        By phollott

        from Vancouver Island, BC

        About Me Designer, Developer

        Verified Reviewer

        Pros

        • Accurate
        • Helpful examples
        • Well-written

        Cons

          Best Uses

          • Intermediate

          Comments about oreilly Functional JavaScript:

          I love this book.

          I work at a mid-size IT consulting company, and we are making the transition from Java and .NET based solutions using server-side technologies to more of a client-based approach. On a project basis, we will have some developers who are upgrading their skills from Java to JavaScript, developers who are learning libraries like JQuery, Underscore and Backbone, and developers who are shifting from these libraries to frameworks like Angular.

          For all of these developers, we have a need for coding best practices, and this is where reading a book like Functional JavaScript with Underscore really shines, because it shifts gears into a more academic approach to JavaScript, and it provides great examples of the right way to implement a design pattern in a largely framework agnostic way, since a lightweight approach to JavaScript augmentation is part of the design philosophy of Underscore.

          This is a great book for development managers who want to improve their ability to code review JavaScript code; for a better understanding of JavaScript patterns like MV*, Addy Osmani's book on Learning JavaScript Design Patterns is also highly recommended.

          (2 of 2 customers found this review helpful)

           
          5.0

          How Javascript Was Meant to Be Written

          By Carlo

          from Brooklyn, NY, USA

          About Me Developer, Maker

          Verified Reviewer

          Pros

          • Accurate
          • Concise
          • Easy to understand
          • Helpful examples
          • Well-written

          Cons

            Best Uses

            • Expert
            • Intermediate
            • Novice
            • Student

            Comments about oreilly Functional JavaScript:

            This book should be required reading for any and every javascript programmer. It's well-written, contains hundreds of useful examples, and breaks down very technical concepts of functional programming into easy to digest pieces. My favorite programming book of 2013 and the best book I've read on Javascript in a very long time.

            (2 of 3 customers found this review helpful)

             
            4.0

            It should be read more than once

            By miro

            from Banja Luka Bosnia and Herzegovina

            About Me Developer

            Verified Reviewer

            Pros

            • Accurate

            Cons

            • Not comprehensive enough

            Best Uses

            • Intermediate

            Comments about oreilly Functional JavaScript:

            I find this book while I was trying to learn about the functional programming from the bits that I found in other sources. This book covers an incredible paradigm which is located in my favorite language. After reading I literally experienced programming enlightenment. True, it took a lot of effort to understand some parts. This is largely my fault, because for the first time I am seriously dealing with functional programming. As for content, I think the author has done a great job. My biggest criticism is about thisg that is often found in books about programming. Simple, good programmers sometimes are not good writers. The impression is that the author deals with the same theme throughout the book, with no clear boundaries between chapters. It's hard work to make the reader realize that does he/she don't read the same chapter, but different. Perhaps the author's intention was to write in "functional style", composing chapters like a functions.

            (3 of 3 customers found this review helpful)

             
            5.0

            "Fun JS" helps show the way to better JS

            By Rob F.

            from Burlington, VT

            About Me Developer

            Verified Reviewer

            Pros

            • Accurate
            • Concise
            • Easy to understand
            • Helpful examples
            • Well-written

            Cons

              Best Uses

              • Expert
              • Intermediate

              Comments about oreilly Functional JavaScript:

              My name is on the back cover, and that blurb probably says it all but...

              I had the privilege of reading some early drafts of this book and seeing it take shape. Fogus has written an outstanding book here and one that I could see joining the ranks of canonical JS texts like JavaScript: The Good Parts, Professional JavaScript for Web Developers, and JavaScript: The Definitive Guide (aka "el Rhino Diablo"). Just like Underscore is a surprisingly-small-yet-surprisingly-powerful library, so this book is surprisingly dense. This probably shouldn't be your first JavaScript book, but if you're familiar with the language already, then this is an excellent introduction to the functional programming paradigm, as well as how to apply those concepts to JavaScript. I'm particularly impressed with how accessible he makes some of these concepts (e.g., pipelining, trampolines, protocols) which can sometimes seem a bit... obtuse and academic. Fogus really shows how these powerful techniques can be used with great effect in JavaScript, but also how JavaScript itself makes some of these concepts possible (and even trivial) to implement.

              Seriously: JavaScript is everywhere, it's the lingua franca of the web, and as we do more powerful things in the browser, we're going to need more powerful programming paradigms. "Functional JavaScript" helps show the way.

              (2 of 2 customers found this review helpful)

               
              4.0

              This book will inspire new libraries

              By ecomware

              from USA

              About Me Developer

              Verified Reviewer

              Pros

                Cons

                  Best Uses

                  • Intermediate

                  Comments about oreilly Functional JavaScript:

                  I suppose a challenge for a writer with experience in functional programming would be maintaining proper perspective on how abstract he might be in presenting his topic. Mr. Fogus has done a respectable job with that in this book. (The point is that he sometimes asks us to overlook what isn't important, but it shouldn't confuse or distract readers who have at least an intermediate understanding of the language.) He acknowledges the other useful paradigms within the community of JavaScript programmers, and still manages to share the essence of his own. Basic issues in this first version may easily be forgiven. It is sometimes noticeable when the author switches from a casual tone consistent with O'Reilly books in general to one slightly more affected, but readers likely won't retain any doubts about his expertise.

                  More important, unlike the compositional ideology that books like Learning JavaScript Design Patterns espouse, which tends to manifest itself in assembly-like thinking, Functional Javascript will make those readers who apply its information better overall programmers. Further, it would not surprise me if several key ideas within it spark new fads within the community and lead to the proliferation of extremely tight, elegant, and useful new libraries. Anyway, it should. Good work, Mr. Fogus. And thank you to the O'Reilly team.

                  Displaying reviews 1-8

                  Back to top

                   
                  Buy 2 Get 1 Free Free Shipping Guarantee
                  Buying Options
                  Immediate Access - Go Digital what's this?
                  Ebook: $19.99
                  Formats:  DAISY, ePub, Mobi, PDF
                  Print & Ebook: $32.99
                  Print: $29.99