News for hackers. Stuff that matters.
Re:Asynchronous programming and cooperative multitasking by stock_toaster on Sunday February 10, 2019 @04:13AM (#19127012)
Don't futures/promises help alleviate the last two cons under callbacks ("callbacks swallow exceptions" and "callback after callback gets confusing and hard to debug")?

Odd that they weren't mentioned.

Re:Asynchronous programming and cooperative multitasking by simcop2387 on Sunday February 10, 2019 @04:23AM (#19127041)
They're a step towards it, but they don't really solve the callback after callback on their own. You need something like a ->get() or await on them to be able to serialize the flow of things to completely solve that.

But that encapsulation of success or failure does do wonders for helping the swallowing of exceptions, by basically wrapping the async operation in a try/catch that carries it over for you.

Re:Asynchronous programming and cooperative multitasking by luminousmen on Sunday February 10, 2019 @04:26AM (#19127050)
"callbacks swallow exceptions" - I guess you're right, but I'm talking not only about JS implementation here. I'll delete it to generalize

"callback after callback gets confusing and hard to debug" - I think it is true even for mature developers