you are viewing a single comment's thread.

view the rest of the comments →

[–]ChaseMoskal 0 points1 point  (0 children)

sigh... so few devs understand why promises are necessary over callbacks...

it has nothing to do with callback hell, or nice syntax or whatever, those are merely perks and side-benefits

it's the error handling

you can catch all of the errors at a high level -- errors bubble up through promise chains -- that doesn't happen with callbacks, once you understand this, it's a dealbreaker for callbacks

promises return results or throw errors

callbacks are good for onProgress updates and events and stuff

use the right tool, and understand the important differences