Pitfalls of Disposing Blindly When Using IDisposable Resources

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 … →

 

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. … →

 

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 … →

 

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 … →