Hacker News new | ask | show | jobs
by bfred_it 3174 days ago
Surely it's nice not having to worry about it, but how is that better over explicit await?

If a sub-sub-sub-function suddenly decides to yield, you might not even know that your whole path is waiting for that. Right? Perhaps you need baz() to run asap but that isn't clear without looking deep into bar().

1 comments

One big advantage is that higher order code can work with both sync and async code. The simplest example would be a for each iterator but this also applies to anything else that calls a function or method that is passed in