For the past half year, I have been maintaining a project that has accumulated over the past three years with a constantly fluctuating team of up to eight different developers. Because there was no firm architecture and no coding conventions or best practices, there are a lot of different styles, repeated code, and general nastiness to wade through. In this time, I’ve compiled a few software maintenance tips to help ease the pain.
Use an Architecture
Your project certainly has some kind of architecture, but it may not be entirely intentional or it may only account for some parts with others being added on that were not originally considered. An architecture that considers all of the current functionality will make it easier to encapsulate old functionality, enable reuse and prevent duplication, and will guide you in adding any new features. Do some research on what architecture would best fit your project and talk to your manager or anyone in your company who has experience with architecture.
Why is it crucial to have an architecture that meets these goals?
- It will prevent you from having to make the same fixes in different places.
- It will allow you to insert new functionality in logical, consistent places.
- It will allow you to make modifications incisively by separating the concerns of different parts of your code.
Use A Code Standard
Work on a standard for writing code or choose an existing one. It is a good idea to use one that is recommended for the project’s tech stack, like the .NET Best Practices for MVC projects or a popular tech-agnostic one like Agile. Choosing to create one for your project is the first of many choices: camel case versus pascal; how object members and privacy levels will be represented in naming; whether or not you will use paradigms like fluent method chaining. The main thing in adopting a standard is readability; a type member starting with a lower case letter should mean the same thing throughout your program. (eg. a private member)
Once you’ve decided on standards, you can start applying them to old code. It is best to apply them as you apply fixes, modifications, and new features. Tools like ReSharper make this immensely easier by providing helpers for refactoring and propagating changes throughout the code.
BlogSlayer is the official blog of FrogSlayer, a custom software product development shop in Bryan/College Station, Texas. Our specialty is getting your product to market in 90 days or less. If you would like a free consultation for your project or big idea, email us at firstname.lastname@example.org. You can also connect with us on Twitter, Facebook, or LinkedIn.