3 ms·
Ex-.NET guy here, can confirm. Coming from JVM-land I was constantly told that async await is something that makes C#/.NET much better than Java. I personally c
by shikharraje 5y ago
Ex-.NET guy here, can confirm. Coming from JVM-land I was constantly told that async await is something that makes C#/.NET much better than Java. I personally could not understand why. Async await is not as easy as it looks, and most .NET programmers who I knew, would just hammer at things to make it work.
"Hey, this is an HTTPClient call? Put an await in front of it?"
"Oh, is the IDE showing an error? Try .ConfigureAwait(false)?"
"Oh, still some issue? Try putting async in the method declaration?"
"Still showing an error? Remove the .ConfigureAwait() and just try async?"
At some point, Visual Studio would stop showing warnings and errors, and then the code would pass review.
Go is better in the sense that, at least people understand what a goroutine is and how/when to use it correctly.
- thrower123 5y agoasync/await is so much wildly better than previous version of .NET async programming. If you've ever had to deal with the IAsyncResult pattern in older .NET code, you'll never complain about await. https://docs.microsoft.com/en-us/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm https://docs.microsoft.com/en-us/dotnet/standard/asynchronou...
- Hawxy 5y ago> most .NET programmers who I knew, would just hammer at things to make it work. I hope the examples you listed are facetious or from the very early days of async/await in C#, otherwise I'd seriously question the skillset of the supposed .NET programmers. Visual Studio is fairly good at handling incorrect use of async/await, and in all of the examples you listed, the actual solution should've been "read the IDE error, hit the bulb and apply the automatically suggested fix", not "ignore the IDE error and smash keyboard until it works". ConfigureAwait usage is also not something you'll usually see outside of library code in modern C#.