Svitla Smart Talk: Async — biggest mistake in C#? Event summary.

Svitla Systems
2 min readFeb 19, 2021

On February 9, 2021, Svitla Systems hosted a webinar led by Adam Furmanek (.NET Expert and author of “.NET Internals Cookbook”) to talk about “Async — Biggest C# Mistake.”

The webinar focused on using Async in C# .NET. The speaker explained why using asynchronous programming is expensive with C# and why Async has hidden states in ASP.NET and ASP.NET Core. This concept is shown on the console and GUI examples and confirmed with unit tests.

Adam showed how Async doesn’t integrate with the .NET platform and gave a number of programming examples in the presentation that prove why Async breaks decent programming principles. For instance, the first principle of multithreading “Never wait without a timeout” is broken.

In addition, the webinar showed how the Dependency Inversion Principle is broken in the .NET platform and why not adhering to it increases unwanted complexity and requires workarounds to be implemented. Adam showed why Asynchronous code does not block the operating system level thread.

The presentation also covered coroutines (coroutine compiler level transformation), fibers (do not block the operating system level thread), monads (statically bound promise factories), and generics (service locator for promise orchestration).

Some of the best practices that Adam suggested include:

  • Know your synchronization context — and don’t abuse it!
  • Do not use Async void methods if you don’t have to.
  • Have Async all the way up.
  • Don’t wait for asynchronous methods in synchronous code if you don’t have to.
  • Avoid creating threads if you can.
  • Always await tasks, handle all the exceptions.
  • Always add handlers to unobserved exceptions and unhandled exceptions.

We highly recommend that you watch the video on our YouTube channel for more information and cool insights about these tools and technologies.

If you’re interested in learning more and participating in our future events, go to our site where we publish all announcements. Svitla Smart Talks are online and offline events where experts share insights and knowledge across several software development topics. The goal of these webinars is to help you learn more about different programming languages, frameworks, and tools to enhance your professional skills and connect with the most proficient and smart developers in the industry.

The Svitla Smart Talk’s atmosphere is open for a lively discussion and making new acquaintances. JOIN US!

--

--

Svitla Systems

Founded in 2003, Svitla Systems is a proven custom software development and testing provider, headquartered in San Francisco, California. www.svitla.com