Improve your code: Improving code quality one class at a time
July 3, 2008 4:17 pm .Net, Improve Your Code, ReadifyWhen I’ve started in my current project more than eight months ago we’ve decided we want to do it right! We wanted to do the best we can to get not only a quality product but to have also high quality code.
I think a quality product is not one that is only well tested but also well coded, maintainable, easy to change when need arises (Agile?), testable, consistent, have as little plumbing code as possible and following proper design patterns in every step.
I’ve seen way to many times projects where code quality degrades with time and most of the times it’s for one of the following reasons:
- project evolves, people develop new patters and don’t retrofit them to existing code so old code is different than new code
- The risk here is even greater if developers introducing new patters don’t let the other developers know about them or standardise the new patterns and you get mixed code with mixed coding patterns or styles.
- as developers are added to the team that are not correctly integrated and start to develop their own patters (and practices)
- pressure to finish requirements in time makes people take shortcuts with “I’ll fix it later” type of approach
So one of the things we started to have in this project is an “Improve Your Code” email that is used to tell all developers about new patterns that we start to apply, simple ways to write better code or simply enforcement(s) we want to put in place to ensure consistency and simply better code.
One other type of email we had was “Tip of the day” offering some cool stuff that can make your life as a developer simpler, better or quicker.
Now, the project is winding up so I thought I’d share some of our Improve Your Code and Tip Of The Day emails we had. Some might be obvious, some might be odd or debatable but even so they might be worth sharing.