1. Introduction to maintainability
A computer programmer writes source code. Once the code has been created and stored in a file, you could in theory just forget about how it's put together. After all, the program will run perfectly well for anyone, regardless of whether they understand how it works.
But if someone needs to change that program later, then they will have to make changes to the code that it's made from. People forget why and how they wrote the original code, or new people are brought on to change it who might have never seen it before.
So it's important to make your code as readable and easy-to-follow as possible.
This feature of code is called 'maintainability'.
A program may need modifying for any of the following reasons:
- To add a new feature
- To fix a bug
- To improve the speed or performance
- To port it so that it will run on a different CPU or Operating System
The process of ensuring that code can be easily amended or updated is called Maintainablility.
There are several standard techniques to help with maintainability that every programmer should follow, regardless of which programming language they use to write their code.
We will discuss these techniques in the following few pages, using a worked example to demonstrate.
Challenge see if you can find out one extra fact on this topic that we haven't already told you
Click on this link: Code maintainability