Re:Promises/A+ - understanding the spec through implementation
by jbmartin on Wednesday August 21, 2013 @12:05PM
(#6251258)
I found Async Javsacript by Trevor Burnham super helpful for learning how use promises properly. However, it doesn't cover the javascript implementation of a promise (uses jQuery), so this is a nice blog post complementing that material.
Re:Promises/A+ - understanding the spec through implementation
by tieTYT on Wednesday August 21, 2013 @03:46PM
(#6252870)
What's a promise? This article seems to assume you know that when you start reading. Here's my understanding: Sometimes in code you get into callback hell. A callback calls a callback calls a callback. Your code starts to grow horizontally more than vertically like this:
Re:Promises/A+ - understanding the spec through implementation
by AdrianRossouw on Thursday August 22, 2013 @09:21AM
(#6256925)
since jquery 1.8 they fixed the most outrageous limitation with their deferred implementation (then should return a new promise), and I actually prefer their implementation.
that said, i make use of underscore.deferred, which is the jquery implementation as an underscore mixin.
I know I didn't immediately see the point of them, and had to sit down and learn to use them properly before I was convinced.
Promises are a solution to that problem. They let you take something that would be callback hell and write it sequentially.
Keep in mind it's the blind leading the blind here. I just learned this term a month ago. Please correct me if I'm wrong.
That said, I found http://promises-aplus.github.io/promises-spec/#terminology to be more informative than the article itself (no offense)
[1] http://domenic.me/2012/10/14/youre-missing-the-point-of-prom... [2] http://documentup.com/kriskowal/q/#
that said, i make use of underscore.deferred, which is the jquery implementation as an underscore mixin.
[1] http://www.infoq.com/news/2013/07/core-async