3 ms·
in my experience, "async" allows you to write the code linearly, but now the code is executed out of order, which is actually much more confusing (for me) to de
by jstrong 7y ago
in my experience, "async" allows you to write the code linearly, but now the code is executed out of order, which is actually much more confusing (for me) to debug and deal with. however, I'm interested to try the rust version to see whether the more explicit types, etc. make this easier to deal with than e.g. `async def` in python, which I find hideously complicated compared to normal event loops.
- jkoudys 7y agoDouble as confusing if you're used to taking a more fp approach, too. I definitely went overboard with await when it first came to JS, but nowadays I've found a new respect for .then. Especially in TypeScript where it's easier to chain the functions and worry less you're using them wrong. Many of the functions I'll write for a .then will find their way into an Array#map or an observable too.
- yawaramin 7y ago> in my experience, "async" allows you to write the code linearly, but now the code is executed out of order Nope, the code is executed in order. That's what `await` accomplishes. Wherever you use `await` you have a guarantee that anything that comes after it will only execute when the promise that was awaited, has resolved.