4 ms·
I'm not disagreeing with you at all. I guess we're using "structured" in different ways. Libraries like TameJS do wind up creating structures to deal with for
by crazygringo 13y ago
I'm not disagreeing with you at all.
I guess we're using "structured" in different ways. Libraries like TameJS do wind up creating structures to deal with for loops, in the same way you'd otherwise manually have to deal with. Likewise with exceptions (which I said are the main actual benefit to await, that can't be reproduced in normal callback routines).
You obviously have to write a bunch of "plumbing" code to do with "raw" callbacks, in complicated situations (like loops), which "await" does on its own -- and writing that plumbing is annoying, although there are libraries to help.
My only point is, the fundamental structure of your program, on a conceptual level, is still the same. Everything's still running the same way, in the same order. It's just more concise, with less plumbing of your own, using "await". So the micro structure is different with await, but the high-level structure is no different. You can't "abuse" callbacks in the way you can abuse goto. Maybe I should have made that clearer.
- danabramov 13y agoI see your point. Closures also don't affect structure on conceptual level, but I think they're pretty darn useful. By the way, async can affect things on conceptual level if you embrace[1] it (I posted this link somewhere below as well, but just in case you haven't seen it). [1]: http://praeclarum.org/post/45277337108/await-in-the-land-of-ios-scripting-users http://praeclarum.org/post/45277337108/await-in-the-land-of-...