4 ms·
That looks like Microsoft's new "async everywhere" approach to API design. It's probably a pretty good idea in concept, but I hope they don't expect C++ develop
by twoodfin 14y ago
That looks like Microsoft's new "async everywhere" approach to API design. It's probably a pretty good idea in concept, but I hope they don't expect C++ developers to actually write those awful nested lambda .then() blocks for what are conceptually sequential actions.
- marshray 14y agoI expect you can define named functions for your "conceptually sequential actions" if you prefer.
- twoodfin 14y agoSure, but is that much better? It reminds me of having to create named struct classes to simulate closures prior to C++11 lambdas. The language syntax just doesn't support that style of programming.
- marshray 14y agoSo how many languages actually do support this style directly? The C# async keyword looks pretty clean, just give C++ a decade or so to catch up.
- MichaelGG 14y agoIs there a better approach available in C++? In other languages you'd use monads or other special compiler forms that can rewrite sequential looking code into the horrible multi-nested callback/error handling code it needs to be.
- ajasmin 14y agoBoost Coroutines perhaps? http://www.boost.org/doc/libs/1_53_0/libs/coroutine/doc/html/index.html http://www.boost.org/doc/libs/1_53_0/libs/coroutine/doc/html...