Maintainability Flashcards
Why does maintainability matter?
a programmer might return to a program they wrote before to add an extra feature, or to remove errors
understanding the code, and therefore modifying it will be easier if it is written in a maintainable style
four features of maintainability
- comments
- sensible variable names
- indentation
-space between different sections of code
comments
lines in programs that provide information about what the different parts of the program do
not executed when the program is run
sensible variable names
often meaningless variable names such as x or y are chosen
this makes understanding them much more difficult
e.g.
height
instead of
H
indentation
code within selections or iterations should be indented
this allows the programmer to easily see which code falls within the selection or iteration, and when it ends
some programming languages indent automatically