ProudCloud Weekly #3


Nick Proud

Microsoft MVP, CTO @ nexbotix.ai and Author at dometrain.com

September 20th, 2025

✉️ ProudCloud Weekly #3

Complacency is easy. With any language, it's easy to become set in your ways and to allow the pressure of shipping fast influence you into cutting corners.

I know, because I've done it.

In this issue I'm going to run through some common mistakes C# developers make all the time. If you aren't falling into any of these holes, congrats. This issue probably wasn't for you! But I do hope you'll stick with me :)

Avoiding common pitfalls is not just important for writing better code - it's important because like any habit, it's hard to reverse the more you do it.

Most people learning a language don't have the benefit of having their code reviewed, or they might be working in a position where peer-review culture isn't a thing. If this is you, let's sort it out.


Stop Writing Code Your Future Self Will Hate

Let's explore the top ten C# mistakes developers make.

1. Not Disposing IDisposable Objects

Forgetting to call Dispose() or use using statements on IDisposable objects (like SqlConnection, Stream, HttpClient) can cause memory leaks and socket exhaustion.



2. Blocking Async Code

Mixing async/await with .Result or .Wait() blocks threads and risks deadlocks (especially in ASP.NET).



3. Hardcoding Magic Strings / Numbers

Sprinkling "CustomerId" or 42 all over the code instead of constants or enums makes refactoring painful and brittle.



4. Ignoring Null Reference Handling

Assuming objects are never null leads to NullReferenceException.



5. Overusing static or Singleton

Making everything static or forcing a singleton when dependency injection would be better reduces testability and flexibility.



6. Inefficient LINQ Usage

Calling .ToList() too early, nested queries inside loops, or not realizing LINQ is deferred execution.


7. Not Using ConfigureAwait(false) in Libraries

In library code, skipping ConfigureAwait(false) can cause context-capturing bugs.



8. Overcatching Exceptions

Catching Exception everywhere and swallowing it (e.g., catch (Exception ex) { }) hides bugs and makes debugging a nightmare.



9. Using HttpClient Wrong

Instantiating a new HttpClient per request instead of reusing it causes socket exhaustion.



10. Not Leveraging Modern C# Features

Writing verbose code (manual property backing fields, if checks instead of pattern matching, foreach loops where LINQ is clearer).


Started Working with AI in C# yet? It can be emotional....

Check out my YouTube channel 👇

video preview

That's it for this issue. I hope you found the content useful. Stay tuned for more updates, and don't forget to stay in touch with me on LinkedIn. My DMs are open.

Keep learning and growing,

Nick Proud

ProudCloud.dev

Stuff you should deffo check out 😁

The Proud Cloud

Subscribe for deep dives into .NET development, intelligent automation, and practical AI tips. Each edition delivers hands-on insights, industry news, and coding techniques to help developers and tech leaders stay ahead

Read more from The Proud Cloud

Nick Proud Microsoft MVP, CTO @ nexbotix.ai and Author at dometrain.com October 4th, 2025 ✉️ ProudCloud Weekly #5 When C# needs low level interactions, P/Invoke saves the day If you’ve ever hit the limits of what the .NET framework or .NET libraries provide out of the box, Platform Invocation Services (P/Invoke) is your bridge to native code. P/Invoke lets you call unmanaged functions from DLLs (like Windows APIs written in C or C++) directly from your C# code. For example, if you need access...

Nick Proud Microsoft MVP, CTO @ nexbotix.ai and Author at dometrain.com September 27th, 2025 ✉️ ProudCloud Weekly #4 Is C# like python now? .NET brings a significant change to the way we can execute C# projects. With the new File-Based Apps feature, developers can now ditch the .csproj files if they wish, opting instead for running a single .cs file from the CLI. This change makes C# more lightweight and approachable, especially for quick prototypes, scripts, or learning scenarios. You no...

Nick Proud Microsoft MVP, CTO @ nexbotix.ai and Author at dometrain.com September 13th, 2025 ✉️ ProudCloud Weekly #2 Databases. We're updating them, inserting, deleting, querying and modifying them all the time. Queries stand out as one of the most common operations for developers building customer-facing apps, and for C# developers in particular, a significant portion of the community are abstracting the SQL layer away with Entity Framework. But just because we're using an abstraction like...