
Local functions in C# (aka nested methods)
C# 7 introduced a new tool for the belt - local functions. Let’s take a look at what they are, how to use them, and why we might not want to.

C# 7 introduced a new tool for the belt - local functions. Let’s take a look at what they are, how to use them, and why we might not want to.

Checking for nulls in C# is tedious, but C# 6 gave us the null-conditional operator. Let’s see what we can do with it!

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.

Unit testing a WinForms app is an uphill battle in the best of times, before you add in classes like MessageBox. Let’s make the best of it.

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.

Using the async/await pattern in WinForms is an easy win, helping prevent one of the most annoying user experiences - a frozen UI.

All programming languages have gotchas to trip you up, and C# is no exception. Today, let’s check out the subtle (but significant) difference between “throw” and “throw ex”.

This error might look a little cryptic at first glance, but it’s fairly descriptive in explaining what’s wrong. You’re likely to come across this one before your first cup of coffee.

Did you know most languages have a way to pass around code to other functions, so you can call (invoke) it in other parts of your application? In C#, it’s called a delegate.

If you’re writing a WPF application and need to find the state of the Num Lock, Caps Lock, or Scroll Lock keys, you’re in luck - there’s a method for that.