Learning jQuery Deferreds
Taming Callback Hell with Deferreds and Promises
Publisher: O'Reilly Media
Final Release Date: December 2013
Pages: 132

Orchestrating asynchronous function calls in JavaScript often leads to callback hell, but there is a reliable way to avoid this painful state of affairs. With this concise and simple guide, you’ll learn how to use jQuery deferreds and promises, an elegant approach for managing asynchronous calls in both client and server applications.

This book contains 18 examples that use deferreds to solve progressively challenging real-world programming problems, along with 75 stimulating puzzles (and their solutions) that will help you understand how and when to use deferreds. Experienced JavaScript programmers will learn new tricks in a fun way, and become immersed in the practice of event-based programming.

  • Understand the logic behind creating deferreds and returning promises
  • Get a structured explanation of jQuery’s deferred API
  • Delve into the dynamics of using deferreds
  • Explore a broad collection of useful deferred recipes developed by the authors
  • Gain hands-on experience by solving challenges that accompany each recipe
  • Go deeper into deferreds: encounter novel abstractions and mind-bending use cases
Product Details
About the Author
Colophon
Recommended for You
Customer Reviews

REVIEW SNAPSHOT®

by PowerReviews
oreillyLearning jQuery Deferreds
 
4.5

(based on 6 reviews)

Ratings Distribution

  • 5 Stars

     

    (3)

  • 4 Stars

     

    (3)

  • 3 Stars

     

    (0)

  • 2 Stars

     

    (0)

  • 1 Stars

     

    (0)

100%

of respondents would recommend this to a friend.

Pros

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

Cons

    Best Uses

    • Intermediate (6)
    • Expert (4)
      • Reviewer Profile:
      • Developer (6)

    Reviewed by 6 customers

    Sort by

    Displaying reviews 1-6

    Back to top

     
    4.0

    a.k.a. jQuery Deferreds Cookbook

    By Dave

    from Kingston, RI

    About Me Developer, Educator, Sys Admin

    Verified Buyer

    Pros

    • Concise
    • Easy to understand

    Cons

      Best Uses

      • Intermediate

      Comments about oreilly Learning jQuery Deferreds:

      Does a good job of explaining how the deferreds/promises work in chapter 2 which is only a dozen pages. Trying to make it longer would do the reader/learner a disservice, but you couldn't really sell a book that short.

      Chapter 3 is a sort of O'Reilly Cookbook (the authors call it Recipes) and at about 55 pages is the longest section. Several additional JavaScript libraries and various service APIs are involved, but the authors do a fine job of making sure the underlying principles are still clear.

      Chapter 4 (8pp) is your final exam, to see whether you really did learn the concept and points to further reading.

      Was worth my time and 50% off ebook deal price. I've been programming web sites since Javascript wasn't used for much more than document.write()-ing the current date into the page and annoying users with scrolling status line messages, so I have had to keep learning a lot over the years! This book helped.

      I would have preferred to give 4.5 stars here. The book is short enough that some space could have been given to other JavaScript implementations of this important design pattern, even just an appendix comparing/contrasting their syntax would be helpful. Maybe a future version could do so.

       
      4.0

      Great little book for improving JQuery

      By Kajackdfw

      from DFW

      About Me Developer

      Verified Buyer

      Pros

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

      Cons

      • Not A Big Book

      Best Uses

      • Expert
      • Intermediate

      Comments about oreilly Learning jQuery Deferreds:

      If the book had been bigger , i would have given it 5 stars. If you like classic JQuery style code, this book will give you a new level of control to your ajax rich web site.

      (1 of 1 customers found this review helpful)

       
      4.0

      Keeping the promise in the title :-)

      By Muzietto

      from Italy

      About Me Designer, Developer

      Verified Buyer

      Pros

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

      Cons

        Best Uses

        • Expert
        • Intermediate

        Comments about oreilly Learning jQuery Deferreds:

        This is a very clear book, progressive in its exposition and full of examples.
        It covers a useful yet little known part of jQuery. I bought it out of curiosity, being already familiar with futures and promises in Scala and Java. Still I enjoyed reading it very much.

        (3 of 4 customers found this review helpful)

         
        5.0

        Quick, clear intro to a tricky subject

        By mcherm

        from Philadelphia, PA USA

        About Me Developer

        Verified Reviewer

        Pros

        • Easy to understand
        • Helpful examples
        • Nicely Paced Exercises
        • Well-written

        Cons

          Best Uses

          • Developers New To Jquery
          • Intermediate
          • Novice
          • Web Developers

          Comments about oreilly Learning jQuery Deferreds:

          Concurrent or parallel programming is hard - REALLY hard. Like quantum mechanics, it is one of the few areas where the mark of a true expert is that they admit to NOT clearly understanding the subject.

          The "deferred" is an object pattern for handling one piece of the complexity of concurrent code. It helps to bridge the gap between writing things in a linear format as if for a single-threaded computer, and writing a series of triggers that go off when events occur. Those two models are not really compatible, and that can make it quite confusing.

          The jQuery library offers a "deferred" object which is deceptively simple: just a handfull of methods. It could all be explained completely in about a page of text (and IS explained that way if you read the docs). But no one who was not already an expert in the use of the "deferred" pattern could possibly use it correctly.

          And that is where this book comes in. The text slowly explains what the class offers and how it functions, along with the reasons why each design detail is important. And then it presents a series of exercises of increasing complexity -- all reasonable real-world examples, by the end of which you will fully understand how concurrency can be tamed (partly) with the deferred class. I am a reasonably skilled programmer (20 years experience, at least 15 with concurrent programming) and I found the pace to be about right: everything explained VERY clearly with examples (which is exactly what you want for a tricky subject no matter HOW well you know it).

          If you've been using jQuery deferreds for a couple of years now you should probably skip this book -- by this point you may be an expert. But for everyone else who thinks they might be using them, this is a great little tutorial and I recommend it highly.

          It is important to discloss that I am friends with one of the authors and I helped to provide editing feedback while the book was in draft form.

          Michael Chermside
          http://mcherm.com/

          (1 of 1 customers found this review helpful)

           
          5.0

          Callback order from callback soup

          By David

          from Italy

          About Me Developer

          Verified Reviewer

          Pros

          • Accurate
          • Concise
          • Helpful examples
          • Well-written

          Cons

            Best Uses

            • Expert
            • Intermediate

            Comments about oreilly Learning jQuery Deferreds:

            As both client and server side JavaScript programs become ever more complex, managing and synchronizing activity between many different asynchronous calls becomes both tedious and error prone.

            In this book the authors explain how utilizing the burgeoning Promises abstraction in JS can greatly simplify code creation and maintenance.

            The book is packed with numerous code examples which not only bring simplification and clarity to otherwise complex code (callback hell), but often provide quite obvious performance benefits too.

            This is a great book, highly recommended.

            (3 of 3 customers found this review helpful)

             
            5.0

            Excellent little gem!

            By Bork Bork

            from London

            About Me Developer

            Pros

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

            Cons

              Best Uses

              • Expert
              • Intermediate
              • Novice
              • Student

              Comments about oreilly Learning jQuery Deferreds:

              A well written book that explains quite complicated matters in a clear and elegant way. A joy to read!

              Displaying reviews 1-6

              Back to top

               
              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