Managing resources effectively in .NET is critical for both application stability and performance. In this post, we’ll explore the proper use of the IDisposable pattern, guidelines for when to dispose objects using a using statement, and some pitfalls of disposing objects blindly—such as disposing shared resources. Understanding IDisposable The IDisposable interface provides a standardized way …
Programming
C# Coding Conventions: Adapting a Standard to Your Team
When a team decides it needs a coding convention, the usual move is to borrow one from a big company, such as Microsoft’s C# conventions, the Airbnb JavaScript guide or one of Google’s style guides. That’s a sensible starting point. But each of those documents was written for one company’s team size, codebase and tools. …
ASP.NET Core Best Practices: A Performance Quick Reference
ASP.NET Core is fast by default, and most of the slowdowns in real apps trace back to a handful of habits: blocking on async code, loading too much data in one go, and putting heavy work on code that runs for every request. This post collects those ASP.NET Core best practices in one place, along …
Programming Principles: DRY, KISS, SOLID, YAGNI and More
I’ve written before about the principle I use most when designing software, doing the simplest thing that could possibly work. This post collects the other programming principles and laws I keep returning to, from DRY and SOLID to Conway’s law and Brooks’s law. None of them can be applied mechanically, and several pull against each …
C# Async and Parallel Programming Best Practices
I’ve written about asynchronous and parallel programming before, in the seven most common async mistakes and what SynchronizationContext is. Few topics in C# produce as many subtle bugs. Deadlocks only show up on the UI thread, exceptions disappear from async void methods, and race conditions never happen on your machine and happen every day in …
How Developers Should Learn and Work in the Age of AI
I’ve written before about career strategies that protect you as a software developer in a fast-moving industry. This post asks the same question about one force in particular, AI. Coding assistants started out as a chat window that could explain an error message. The current tools can read a whole repository, change a dozen files …
When to Use Inheritance in C# (and When to Avoid It)
Inheritance is the feature most object-oriented programmers learn first. It’s also one of the most misused. Used well, it gives you a single abstraction that many types can stand behind, and calling code that never needs to know which one it has. Used badly, it gives you hierarchies five levels deep, base classes nobody dares …
Staying Relevant as a Software Developer: A Learning Strategy
Software development is a well-paid job, and a lot of people assume it works like many other professions: you put in a few hard years of study, and after that you mostly apply what you know. It doesn’t work that way. Software development is skilled work, and in this industry skills lose their value quickly. …
Application Secret Management: How to Implement a Good Secret Management Strategy
Sometimes bad things just happen, or perhaps they happen because of our neglect. Bad things like committing an application secret into our repository. The problem with doing that is that if that happens, deleting the secret and committing will not suffice. We need to purge that commit completely from our repository and its history. But …
How to Customize Windows Terminal and PowerShell Using Fzf, Neovim and Beautify it with Oh My Posh
PowerShell on its own it a very powerful tool. But what if told you can make it even better using some tools that you can install on it? Not only that but you can also make it more beautiful/handsome, perhaps with a bit of a personal touch too? So, in this post I’m going to …
