Grant Winney
  • About
  • Code
  • Questions
  • Tools of the Trade

C#  

Using Tuples and deconstruction to return multiple values in C#

Using Tuples and deconstruction to return multiple values in C#

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.
Jan 4, 2023
Named arguments in C#

Named arguments in C#

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.
Oct 12, 2022
Local functions in C# (aka nested methods)

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.
Oct 8, 2022
Checking for null in C#, using the null-conditional and null-coalescing operators

Checking for null in C#, using the null-conditional and null-coalescing operators

Checking for nulls in C# is tedious, but C# 6 gave us the null-conditional and null-coalescing operators. Let's see how they've improved things.
Sep 26, 2022
Using string interpolation to craft readable strings in C#

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.
Sep 19, 2022
Mocking MessageBox (or any static class) in WinForms

Mocking MessageBox (or any static class) in WinForms

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.
Jan 6, 2022
Using nameof to avoid magic strings in C#

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 29, 2021
Send me new posts: *

  • Connect
  • Privacy
  • License
  • Cross-Posting
Grant Winney © 2025. Powered by Ghost