Once a team has coding standards in place, it’s very important that they are enforced. If a programmer has done standards in the past, it’s hard for them to change to a new one. Even more important is making sure they are followed by contractors since their time in the team is limited. The most important is to make sure they are followed by beginners, so they learn right from the get go.
As you can see below, from this survey code review and pair programming are the most used methods in teams.
Both of these methods are good ones, but as we all know, when deadlines are looming these can actually go out the door, especially code reviews. So it’s very important that they are combined with running a code analysis tool during the build process and not release to QA until the minimum number of violations (hopefully that number is zero) is reached.
What tools should you use? The first one I use is Visual Studio Analyze or FXCop (free) if you don’t have the appropriate edition of Visual Studio. The second is CodeIt.Right from Submain.com. Both of these tools can be run during the build process via the command-line. Before I check-in any code to source control I run CodeIt.Right first since it includes auto refactoring and then Visual Studio Analyze. They both follow the same Microsoft Design Guidelines.
To see more results, go to the first post in this series.