Browse by Tags

All Tags » DevCenterPost » Software Development Guidance » C# (RSS)

IDisposable and Class Hierarchies

In my previous post , I showed how the Dispose Pattern is effectively obsolete. But, there’s one area that I didn’t really cover. What do you do when you want to create a class that implements IDisposable , doesn’t implement the Dispose...

The Dispose Pattern as an anti-pattern

When .NET first came out, the framework only had abstractions for what seemed like a handful of Windows features. Developers were required to write their own abstractions around the Windows features that did not have abstractions. Working with these features...

Thread synchronization of non-atomic invariants in .NET 4.5

Now that we’ve seen how a singular x86-x64 focus might affect how we can synchronize atomic invariants , let’s look at non-atomic invariants. While an atomic invariant really doesn’t need much in the way of guarding , non-atomic invariants often do. ...

Thread synchronization of atomic invariants in .NET 4.5

I've written before about multi-threaded programming in .NET (C#). Spinning up threads and executing code on another thread isn't really the hard part. The hard part is synchronization of data between threads. Most of what I've written about...

Visual Studio 2010 Best Practices published

Most of my spare time in the last few months has been taken up by writing Visual Studio 2010 Best Practices . This has now been published and is available through publisher (no longer pre-order) at http://bit.ly/Px43Pw . The pre-order price is still available...

Automated Testing Isn’t Just for Business Logic

I had a conversation with Kelly Sommers the other day that was partially a short support group session on the annoying tendencies of development teams to completely lose focus on the architecture and design principles of a system and let the code base...

If You’re Using “#if DEBUG”, You’re Doing it Wrong

I was going through some legacy code the other day, refactoring it all over the place and I ran into many blocks of code wrapped in “#if DEBUG”.  Of course, after a bit of refactoring in a RELEASE configuration these blocks of code were quickly out...

Developing Windows Services in Visual Studio

Inevitably distributed systems often need a Windows service or two for certain tasks. The creation of a Windows service project and hooking up a project installer to the service is fairly straightforward; so, I’m not going to get into much detail...

Deep Dive on Closure Pitfalls

I've blogged about closures in C# and their pitfalls before. I keep seeing problems with closures--more now that lambdas expressions and statements ("lambdas") are becoming more widespread--even with experienced developers. So, I'd thought...