Hacker News new | ask | show | jobs
by SeanDav 4824 days ago
I don't agree that there is any fundamental difference in functionality between callbacks and promises.

Promises don't somehow magically make asynchronous code easy to write while leaving callbacks out in the cold. They have very similar strengths and weaknesses and I didn't find any of the OP's arguments compelling.

In fact, if I had to choose, I would take the opposite view and say callbacks are neater, cleaner and more consistent than promises.

1 comments

Promises are values, and you can use them to compute things. Callbacks are procedures, and are non-composable in non-trivial ways (you can chain callbacks very simply, but that's basically it).