Maintainability
If my code works why should I care about maintainability?
Programmers care about writing code which is easy to maintain because...
- We frequently leave the program for a while and then have to come back to it to fix a bug or add new code.
- We frequently work in teams where someone else will need to understand our code.
Here are some ways to make your code easy to maintain.
Comments
Comments enable programmers to understand the purpose of each section or line of code. To find out how to add comments in C# click here.
Variable naming
Variables should be named sensibly using a noun to describe the values which will be stored e.g. name = "Bart"
.
Modularity
Code should be broken up into procedures and functions to allow for re-use and to make it easier to test.