Having not blogged in some time, I've decided to start a series of posts discussing small improvements developers can make when writing code. These are things that take little time to do (especially with decent tooling) but cumulatively have a large effect on the quality of the code.

The kind of improvements I'll be discussing are things that developers can add to new code, but more significantly are changes that may be made to existing code as it is altered. The general approach is to leave each code file in a better state than the one you found it in. By making a number of these small improvements over time when working with code that you would already been modifying you can gain progressive improvements in code quality over time for marginal cost.

Of course, nothing is free, so there are a few downsides. Firstly, all code changes represent risk so this needs to be appropriately managed. Proper unit testing and automated tools (like ReSharper) can be very effective in this. Secondly this kind of low level changes will not improve the architecture of your system. If the problem with your application is that it's poorly architected then you will need to consider a dedicated refactoring effort or reimplementation.