DEV Community

Discussion on: .NET Threading Gotchas

Collapse
 
vasar007 profile image
Vasily Vasilyev • Edited

Stephen Cleary has series about async. Check out this article to find full answer for your question.

TL;DR:

  • Don't elide by default. Use the async and await for natural, easy-to-read code.
  • Do consider eliding when the method is just a passthrough or overload.
  • Remember that eliding async changes semantic of your code (e.g. there are some pitfalls with exceptions and stack traces).

As for me, I almost always don't elide async because I had really hard-tracking issues because of eliding async several times. So, my rule is to elide async only when you should do it (e.g. in performance critical places).