Using nameof to avoid magic strings in C#

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.

  Dec 30, 2021 (rev. Sep 16, 2025) ·  6 min

How to log errors in WinForms using NLog

Logs are a great tool for squashing bugs and tracing errors. Let’s see how to add NLog to our project.

  Oct 9, 2021 (rev. Sep 16, 2025) ·  5 min

Move a subdirectory into its own Git repo, with history

Need to pull a subdirectory out of repo A and create a new repo B out with it? Including full history and branches? Okay, here’s how.

  Jul 30, 2021 (rev. Sep 16, 2025) ·  2 min

Using MVP to test a WinForms app

If you find yourself supporting a WinForms application, you’re likely to notice the tests… or lack thereof. Just because we may not have been so focused on automated tests and continuous integration when WinForms was younger, that doesn’t mean we can’t introduce them now. Better late than never!

  Jun 9, 2021 (rev. Sep 16, 2025) ·  9 min

Using Async, Await, and Task to keep the WinForms UI responsive

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

  Jun 7, 2021 (rev. Sep 16, 2025) ·  8 min

What is mocking a dependency?

When you’re writing tests, you generally don’t want to write to the database, email customers, and hit third-party API’s. That’s why we need to know how to mock dependencies!

  Dec 9, 2020 (rev. Sep 16, 2025) ·  8 min

What is a code review / pull request?

Does the idea of submitting to a code review make you sweat bullets? Or do you brush it off as a necessary evil? It should be a (hopefully positive) conversation, wherein the team agrees to the code they’re all going to have to help maintain, and maybe learns something new too.

  Nov 28, 2020 (rev. Sep 16, 2025) ·  9 min

The right way to rethrow an exception in C#

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”.

  Sep 17, 2020 (rev. Sep 16, 2025) ·  4 min

Creating a basic Word Cloud in Python

We’ve all seen word clouds, like in the sidebars of blogs, but let’s see how we might create our own with a little bit of code!

  Jun 4, 2020 (rev. Sep 16, 2025) ·  2 min

Where should I store application data in Windows?

Windows sets certain locations aside for apps, and makes them easily discoverable for devs to use. Let’s see how.

  May 22, 2020 (rev. Sep 16, 2025) ·  4 min