title: Problems inherent to jQuery $.Deferred (jQuery 1.x/2.x)
body: <p>@Domenic has a very thorough article on the failings of jQuery deferred objects: <a href="http://domenic.me/2012/10/14/youre-missing-the-point-of-promises/">You're missing the Point of Promises</a>. In it Domenic highlights a few failings of jQuery promises in comparison to others including <a href="https://github.com/kriskowal/q">Q</a>, when.js, RSVP.js and ES6 promises.</p>
  
  <p>I walk away from Domenic's article feeling that jQuery promises have an inherent failing, conceptually. I am trying to put examples to the concept.</p>
  
  <p>I gather there are two concerns with the jQuery implementation:</p>
  
  <h2>1. The <code>.then</code> method is not chainable</h2>
  
  <p>In other words</p>
  
  <pre><code>promise.then(a).then(b)
  </code></pre>
  
  <p>jQuery will call <code>a</code> then <code>b</code> when the <code>promise</code> is fulfilled.</p>
  
  <p>Since <code>.then</code> returns a new promise in the other promise libraries, their equivalent would be:</p>
  
  <pre><code>promise.then(a)
  promise.then(b)
  </code></pre>
  
  <h2>2. The exception handling is bubbled in jQuery.</h2>
  
  <p>The other issue would seem to be exception handling, namely:</p>
  
  <pre><code>try {
    promise.then(a)
  } catch (e) {
  }
  </code></pre>
  
  <p>The equivalent in Q would be:</p>
  
  <pre><code>try {
    promise.then(a).done()
  } catch (e) {
     // .done() re-throws any exceptions from a
  }
  </code></pre>
  
  <p>In jQuery the exception throws and bubbles when <code>a</code> fails to the catch block. In the other promises any exception in <code>a</code> would be carried through to the <code>.done</code> or <code>.catch</code> or other async catch. If none of the promise API calls catch the exception it disappears (hence the Q best-practice of e.g. using <code>.done</code> to release any unhandled exceptions).</p>
  
  <p>&nbsp;</p>
  
  <p>Do the problems above cover the concerns with the jQuery implementation of promises, or have I misunderstood or missed issues?</p>
  
  <hr>
  
  <p><strong><em>Edit</em></strong>  This question relates to jQuery &lt; 3.0; as of <a href="http://blog.jquery.com/2015/07/13/jquery-3-0-and-jquery-compat-3-0-alpha-versions-released/">jQuery 3.0 alpha</a> jQuery is Promises/A+ compliant.</p>