Functional JavaScript
Introducing Functional Programming with Underscore.js
Publisher: O'Reilly Media
Final Release Date: 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 11 reviews)

Ratings Distribution

  • 5 Stars

     

    (5)

  • 4 Stars

     

    (6)

  • 3 Stars

     

    (0)

  • 2 Stars

     

    (0)

  • 1 Stars

     

    (0)

100%

of respondents would recommend this to a friend.

Pros

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

Cons

    Best Uses

    • Intermediate (10)
    • Expert (6)
    • Novice (3)
    • Student (3)
      • Reviewer Profile:
      • Developer (11)

    Reviewed by 11 customers

    Sort by

    Displaying reviews 1-10

    Back to top

    Previous | Next »

     
    5.0

    Functional JavaScript

    By Bielawka

    from Toruń, Poland

    About Me Developer

    Verified Reviewer

    Pros

    • Accurate
    • Helpful examples
    • Well-written

    Cons

      Best Uses

      • Expert
      • Intermediate

      Comments about oreilly Functional JavaScript:

      Over the last years the JavaScript returned to favor thanks to the popularity of HTML5 and jQuery. Many developers want to learn more about this language and to know JS's most significant libraries. Very popular products are distinguished by Jeremy Ashkenas. I think all developers heard about CoffeeScript or Backbone.js framework. Ashkenas also is the creator of UnderscoreJs library which provides a very useful utility functions.

      On the second hand, a very common tag is functional-style concept. At every step, terms like closures, currying, folding, come to our ears and eyes. Surely as a programmer you want to read a good book about it. This book should be absorbing, have good style of writing and practical examples. And first of all, author should have a considerable knowledge about things he describes.

      I think Michael Fogus, as a contributor to the Clojure and Underscore.js library is a right person in the right place. While reading, you can fell that the writer has a practical and real-life skills about functional programming and JS. You can see that he devoted much time to bite into this. For example Fogus bring us a precise chapter about closures. Yes! In JavaScript. It's not the frequent term in a base of articles in a world's JS's blogs and books. It is not what a typical developer who writes only Dom-tree-JS-code knows.

      If you want to know how to use things like closures, currying, folding. Or you want to get knowledge about functions as units of behavior, functional recursion on data "table-like" (great thing!), recursion as a base of deeper understanding of a functional style, hiding mutable states, a way to implement laziness, this book may be your first step in an adventure of functional programming in (wait for it!) JavaScript. You will be familiarized with UnderscoreJs functions as a tools in everyday-coding-life.

      Honestly, the only thing that bothered me in this book is the small emphasis of graphic representation in highlighting important terms.

      Besides, "Functional JavaScript: Introducing Functional Programming with Underscore.js" assure many hours spending in reading interesting code, especially if reader will spend some hours to analyze written code and test it in IDE. Surely it should bear fruits in developer's future coding sessions.

      So, if anyone is interested in JavaScript and want to learn about functional programming techniques, this book is a very good start and may change perspective of seeing this language.

       
      4.0

      Exploring FP with JavaScript

      By poseid

      from munich

      About Me Developer

      Pros

      • Accurate
      • Concise
      • Functional Programming
      • Javascript

      Cons

      • Too basic

      Best Uses

      • Expert
      • Intermediate

      Comments about oreilly Functional JavaScript:

      Structure and Interpretation of Computer Programs famously features LISP for teaching programming. Yet, JavaScript together with the Underscore library offers an interesting context for playing with concepts from FP too. No need to download yet another programming language, but you can get started with FP right away. Besides the great point of applying JS instead of Clojure or other FP languages, the book does a nice job on how functional abstractions.

      As with other books on FP too, I find it a bit hard to understand what concepts from FP should be applied in daily development practices. It might have been interesting to see how FP applies to type-checking or to better view rendering in visual programming. That is why I only give 4 stars out of 5.

      (1 of 1 customers found this review helpful)

       
      4.0

      Dig it!

      By Jerry

      from Chicago ex-pat

      About Me Developer

      Verified Buyer

      Pros

      • Helpful examples
      • Well-written

      Cons

        Best Uses

        • Intermediate
        • Novice

        Comments about oreilly Functional JavaScript:

        This book will scratch an itch if
        * You have an object-oriented approach to solving design problems and need a solid introduction to functional concepts
        * You use a framework, such as Backbone/Marionette, that already uses Underscore.js and want to make better use of a tool that's already in your tool chest
        * Want to negotiate with Javascript on its terms rather than trying to force it to exist in to a purely OO world

        This is definitely not a book you can skip around reading. Each chapter, and the code examples in them, build on functions created in previous chapters. Considering that the point of functional programming is to do that very thing, composing ever more complex functions from simpler constructs, the structure is a great example of dogfooding. However, if there is any negative, it's that you find yourself constantly flipping back to previous pages to remind yourself what the function mapcat (or partial1) does and how it works. But really, that is a small price to pay for having your mind blown by viewing the world through functional glasses.

        (3 of 3 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.

                (4 of 4 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.

                  Displaying reviews 1-10

                  Back to top

                  Previous | Next »

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