I personally think that promises do not solve real challenges that are introduced by event-driven programming.
It was huge hype about 2 years ago, and then settled down.
What they attempt to solve: prevent pyramid in code. Thats pretty much it. What they actually introduce:
- Passing data through is ugly and very inefficient (single object with many keys…)
- Many places you need data from few callbacks before - endup building all the same pyramid or pass it in large object.
- Error handling and debugging became awful. You end up writing loads of
.fail where you wouldn’t want to in first place.
- Code become longer than it should be.
Solution to event-driven programming is coming by ES6 and improved by ES7, using generators (
yield), allowing developers to write async code in sync manner and handle all debugging in very common and intuitive flow.
Unfortunately we need some time before it comes to all browsers, and it wont be pollyfilable
No one stops extending and wrapping classic callbacks into promises for yourself, it probably would be ~50 lines js file that would do it for you. But I don’t think that as product we should enforce some paradigms that have lovers and haters, but rather we stay neutral and allow both parties some options on those terms.