What’s Program Understanding?

Print anything with Printful



Program comprehension is important but often overlooked in computer science education. Writing understandable code is crucial, and two strategies for improving program understanding are adding documentation and emphasizing structure. A combination of both approaches is useful, but programmers must be careful not to overdo documentation or assume too much knowledge of syntax and mechanics. Additional documentation or structural changes may be required later, as understanding problems are not always caught.

Program comprehension is the ability of a programmer to understand what the source code of a computer program does. In teaching computer science, understanding a program is often overlooked in favor of learning the mechanics and syntax of the computer language being taught. Writing understandable code, however, is a universal need, regardless of the computer language in which it is written. If a programmer writes a library or piece of code, but no one can determine what he does next, the algorithm and logic behind that code can easily be lost. It is increasingly common for programmers to fail to crack their own code, as it is often not written in a clear and intuitive way.

There are two main strategies that programmers can use to improve understanding of the program, and each has its advantages and disadvantages. The first method is to add documentation to the code during or after coding, and the second is to write code with emphasis on its structure. A combination of both approaches is useful for most programmers, although there are some code builders who prefer one strategy over another. Which method to use is a matter of personal preference on the programmer’s part, and any attempt to clarify the code is much better than none.

Adding documentation to your code is the simpler of the two methods and, when done right, can be a very useful aid to a programmer unfamiliar with the language in which the code is written. Most computer languages ​​have a specific documentation style to aid in understanding the program. If the code documentation is written thoroughly, a new programmer’s first step may be to read all the documentation and comments to understand how the program works, without having read the code. Instead of depending on the syntax and mechanics of the code, the programmer can see what is happening in plain text, then relate the text precisely to what is happening in any given place. However, when adding documentation to code, programmers need to be careful, because too much documentation can be confusing and intrusive, rather than helpful.

When writing code with an emphasis on structure, a programmer assumes that any other maintainer looking at his code will have equivalent knowledge of the language’s syntax and mechanics. Sometimes, this is a valid assumption, but it can’t always be relied upon. Comprehension of the program based largely on structure is possible, but requires much more work on the part of the original programmer to facilitate it. The mechanics and syntax of the language must be followed exactly, as well as all stylistic conventions, and everything must be consistent. When writing code this way, a programmer must always be aware that what is clear to him may not be clear to another person.

Even when writing code with an eye to understanding the program later, additional documentation or structural changes may be required later. This is a natural part of code maintenance and not an error at the hands of the programmer. A programmer’s job is to anticipate as many understanding problems as possible, but not all of them are always caught.




Protect your devices with Threat Protection by NordVPN


Skip to content