-
Book Overview & Buying
-
Table Of Contents
Mastering PLC Programming - Second Edition
By :
Nothing makes programmers groan louder than being told they must write documentation. Unfortunately, documentation is directly linked to the longevity of a codebase. There are many ways to document a codebase. The three most common methods are code comments, external documentation, and the code itself. The first type of code documentation we’re going to look at is self-documenting code.
A well-written program will provide its own documentation. This means that if written properly, a program should be easy to follow with minimal aid. To demonstrate this, consider the following pseudocode:
Input temperature
overHeating = 100
targetTemp = 90
If temperature > overHeating then
ovenFan = on
Elseif temperature <= targetTemp then
OvenFan = off
This program is very clear about how it works, and the variables’ meaning in the program is easily identifiable. This is essentially what self...