Using string interpolation to craft readable strings in C#
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.
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.
One of the many nice functions in LINQ is a single word that iterates through a collection, returning true if at least one item in the collection matches the condition you specify. But what’s the opposite of the Any keyword in LINQ?
Porting .NET Framework code to .NET Standard has been a learning experience, with some challenges too. This time I had a .NET Standard library that expected an application config file, but loading one from an NUnit test suite proved to be more difficult than it sounded at first.