3 ms·
Agreed. Before this and promises it was impossible to reasonable about async scenarios without getting seriously confused. Allowing programmers to write code
by bcheung 10y ago
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.
- kowdermeister 10y ago> 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.
- bengalister 10y agoUsing generators can make your code look as if it was synchronous
- pkolaczk 10y agoRemoves 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.