|
|
|
|
|
by alemanek
669 days ago
|
|
I love async but very rarely use await. It makes inversion of control patterns super easy and avoids deep logic and instead get something much more readable. I treat await as a code smell and always triggers me to evaluate if we really need to be waiting for the result in this place. Most of the time they shoukd just return the promise or put something in a then. People are going to misuse stuff but it doesn’t mean we shouldn’t use appropriate tools when appropriate. EDIT: this is especially true for NodeJS where lots of frameworks are promise/async aware and support you returning a promise to them. |
|
The number of await calls in your codebase should always be greater than the number of async modifiers.