News for hackers. Stuff that matters.
Re:You Can Throw() Anything in JavaScript – and Other Async/... by ThunderSizzle on Friday April 08, 2022 @08:07AM (#30955910)
I personally prefer async/await over callbacks or promises. I find the flow better when I can make an Ajax call just await the result, rather than having to implement a success function.
Re:You Can Throw() Anything in JavaScript – and Other Async/... by paskozdilar on Friday April 08, 2022 @09:44AM (#30956691)
The "lightweight thread" alternative would probably make the Ajax call blocking, so you could just launch a thread that waits for it to finish, then continues on with the rest of its instructions. The "callback hell" wouldn't exist in the first place.

This is exactly what Golang did, and in my honest opinion, it's a breeze of fresh air in the modern mess of processes/threads/asyncawaitcoroutines and all their combinations.