Code that is hard to read makes it difficult to understand what the program is trying to do. It also makes it difficult to understand the purpose of any variables, procedures and functions. Errors are easier to fix when we understand the code we are reading through.
When we document code, we make it easier to read and understand. We also document code in case:
Documenting code is very straightforward. It involves:
Having properly documented code makes it much easier for a programmer to understand and, if necessary, debug the program.