48 points · by shawndumas · 13y ago · 11 comments
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.
callback1
callback2
callback3
callback3ReactionToFailure
callback2ReactionToFailure
callback1ReactionToFailure
As a result, the code is hard to read because it doesn't flow sequentially.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.