Skip to content

Comment on Async/await support in Firefoxparent

Comments

Agreed. Before this and promises it was impossible to reasonable about async scenarios without getting seriously confused.

Allowing programmers to write code as if it was synchronous removes a lot of confusion, boilerplate, and bugs.

impossible to reasonable about async scenarios

Nothing was impossible. Maybe if you had 3+ levels of nested Ajax calls then it needed bit of head scratching, but jQuery's Deferred and other promise libraries are pretty neat to solve these issues.

However this could be indeed hidden from the programmer.

Removes boilerplate? Yes. Confusion? Sometimes. Bugs? Not really. async/await doesn't inherently change the concurrency model, it is just a different notation for the same thing. Therefore you can still have all the same bugs as with classic promises.

Using generators can make your code look as if it was synchronous

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.