Async code isn’t always intuitive, but practicing helps. Let’s take a look at Async, CancellationToken, and IProgress, in a few short examples.
When sending notifications in a WinForms app, a MessageBox is the only way to go… or is it? Let’s get creative and see what else we might do.
Writing async code whenever possible is great, but how do we do it when we’re stuck with legacy (and very synchronous) code?
When it comes to finding a bug in an app, few things beat a good trail of logs. And for writing those logs, few tools beat NLog in simplicity or flexibility. I rarely appreciate just how flexible it is though, so it’s worth spending a little time taking a closer look.
A big challenge with any language is trying to group and organize things sensibly, and returning multiple values is no exception. Let’s check out Tuples and deconstruction, and see how they can help us out.
Sometimes the safer way to “update” old code is to leave it be and paint over it with a newer construct. Let’s see how to modernize a BackgroundWorker using Tasks and TaskCompletionSource.
Named arguments in C#.. they’ve been around a long time, but does anyone use them? Let’s check out another feature that helps tame wild code.
The longer I write software, the more I come to appreciate clear code. String interpolation in C# is just one more way to help us do that.
There’s a lot of ways to make our code work for us. Let’s check out using the nameof operator to avoid magic strings.
Logs are a great tool for squashing bugs and tracing errors. Let’s see how to add NLog to our project.
Using the async/await pattern in WinForms is an easy win, helping prevent one of the most annoying user experiences - a frozen UI.