3 ms·
As someone not familiar with the async/await stuff, I just looked up the official MS documentation and found the explanation pretty obtuse. As much as I can tel
by frou_dh 13y ago
As someone not familiar with the async/await stuff, I just looked up the official MS documentation and found the explanation pretty obtuse. As much as I can tell, it's a way to facilitate, umm, "chained futures", and by the way it's suddenly OK for a type returned to kind-of-but-not-really match the method signature.
I'm sure it's powerful but it doesn't come across as obviously amazing like LINQ did.
- ufo 13y agoI don't know the specifics in this article but usually the analogy I would give is that async/await is to asynchronous programming as yield/generators are to writing iterators. When you can use yield you can use regular control flow like branches, for loops, etc to write iterators in a straightforward manner. If you can't use yield you instead end up needing to represent all that implicit control flow using explicit stacks and things like that. Similarly, async/await let you write asynchronous code very similarly to how you would write a synchronous version of the same thing.