Archive For The “Fundamentals” Category
Here is a contrived example of a common SOLID violation you might see. Can you spot it? Except in trivially simple cases, there should always be a class boundary when shifting context from coordinating a collection versus performing actions on a single object. The class above is violating this rule — it knows how to [...]
So you’ve started writing your first program — great stuff! Here are a few tips and traps to watch out for along the way. Long periods of time when your program doesn’t compile and/or run at all You enthusiastically start work on some big changes (e.g. re-architecting your application), but stop because you hit a [...]
Currently I am responsible for maintaining a big legacy .NET ERP system. It’s plagued by something I like to call cargo-cult commenting — source code comments that are ritually included, for some reason, but serve no real purpose at all. These are the sort of comments that: Are written for aesthetic reasons more than anything [...]
Following on from my article on good source control check-in habits, I’ve got a few tips I’d like to share on exceptions in .NET. These are basically all responses to things I’ve seen done in production code before. Write a method that throws — don’t return success/failure codes Here’s a C function I wrote a [...]
The other day at work I went over a few good source control habits (TFS-centric) for new developers, and why they’re worth doing. Here are some tips: Check-ins are coarse-grained When I first started using source control, a lot of my check-in logs looked like this: Added useful function foo() (that will be ultimately required [...]


