3 ms·
One aspect of C# async/await I don't ever see talked about is the ecosystem integration. Async/await was delivered after the popular .NET UI frameworks (WPF, U
by n8cpdx 5y ago
One aspect of C# async/await I don't ever see talked about is the ecosystem integration.
Async/await was delivered after the popular .NET UI frameworks (WPF, UWP) were designed, and it shows.
Trying to work with data bindings with async is a pain. There are things WPF has to make it a bit easier, but UWP doesn't have them. A lot of the infrastructure (IValueConverter, for example) just won't allow async. There are workarounds, but they are ugly. It gets tricky when, as the document mentions, async is viral. Constructors and void methods (basically the only options for running initialization code when a UI component appears) give you not good options for async/await. A lot of the WinRT API (which has buggy C# bindings and is markedly unreliable) require async for things that were never async in the older implementations. It makes cross-platform library development a pain, and exacerbates the 'async is viral' issue.
None of what I mentioned is a 'problem' in that it can all be worked around and people have been delivering applications with such workarounds for a decade. But it is disappointing that Microsoft hasn't modernized the UI frameworks to take advantage of modern programming patterns.