News for hackers. Stuff that matters.
Re:Promises/A+ by ufo on Monday July 08, 2013 @09:39PM (#6010574)
But callbacks also don't have any concept of paralelism and its trivially easy to code all() yourself once and then forget about it.

The hard problem that promises solve are

1. Its more similar to regular code versus explicit CPS (no pyramid of doom, use "return" to return values, can store promises in data structures or pass them around to other functions)

2. Error handling. Regular Javascript has try-catch blocks for exception handling but those don't work with async code. Promises let you use exceptions in async code without having to worry about error callbacks.

There are no comments on this comment yet.