Ardalis (Steve Smith) speaking at Techorama 2024
Ardalis (Steve Smith)

Software Architect • Microsoft MVP • Clean Code Advocate

MVP Architect Author Speaker Trainer
Work With Me →

Helping other software professionals to keep improving!

Recent Blog Posts

Why a Free Market Fire Department System Beats the Archaic Public Model

Why a Free Market Fire Department System Beats the Archaic Public Model

By a devoted advocate for individual choice


Introduction: Fire Protection, Reimagined 🚒

In a nation that prizes personal responsibility, it’s time to ask whether a single, taxpayer-funded fire department model still serves us best. A market of competing fire protection providers would let every household choose the coverage, response times, and perks that match their unique risk profile and budget. What’s more, it would allow individuals and households to prioritize how they want to spend their money, rather than leaving it up to big government and its known inefficiencies. Let the invisible hand of the market sort out which fire departments offer the best value for their rates, and which properties people find worth protecting with fire extinguishing services.

Read More →
Single File Test Suites in Dotnet Csharp

Single File Test Suites in Dotnet Csharp

This article is part of the 2025 Advent of C# Code Calendar, which publishes 2 C# articles every day in December leading up to 25 December.

NOTE: Originally targeted xUnit v2; now updated to xUnit.v3.

Introduction

One of my favorite new features in .NET 10 is C# file-based apps (or file-based C# programs if you prefer). With this feature, we can create individual .cs files and then run them using dotnet run <file.cs>. On Unix OSes you can go even further and mark the files as executable and include a shebang (#!) directive as the first line to tell the OS what to run it with and then you can run the files directly without even calling dotnet run.

Read More →
Use cd - in Powershell 7 to Return to Previous Directory

Use cd - in Powershell 7 to Return to Previous Directory

Introduction

A command that many shells have had forever and that PowerShell has had for a long time as well is ‘cd -’ which means “change directory to previous folder”. This means you could do something like this:

1
2
3
4
5
6
> cd c:\dev
c:\dev
> cd c:\temp
c:\temp
> cd -
c:\dev

This is quite handy in many situations. In particular, since I’ve modified my PowerShell Profile to NOT start in my users folder but instead to start in my c:\dev folder (from which I can easily get to any repo I may be working from), I very often find myself using cd - whenever I create a new terminal in the folder I want to be in such as when using VS Code.

Read More →
How to Update .NET on Wsl or Ubuntu

How to Update .NET on Wsl or Ubuntu

Ever year or so, a new version of .NET ships, and I need to upgrade the .NET SDK version on my machines. Not just the Windows machines, but also the WSL Ubuntu bits that live on those same machines.

First, determine what version of dotnet you already have using this:

1
2
dotnet --version
> 10.0.100-rc.1.25451.107

Yep, I need to update that. But how? Surely there must be a simple way to do it using just the command line. If you just do a quick search for how to do this, you’ll find instructions like this:

Read More →
The Ardalis Cli

The Ardalis Cli

Back in the .NET 10 Preview days, Andrew Lock wrote about running one-off dotnet tools with DNX. I decided to riff on that to create what was initially just a business card, but then I enhanced it with some additional functionality, making a full-blown Ardalis CLI tool, which mostly just gets you access to content from me in your terminal.

You can find the source for my ardalis command line interface as well as its listing on NuGet. You should review these before running commands on your machine to ensure the tool isn’t doing anything nefarious.

Read More →