
Q-20 Solved Question Papers
(4) Don’t contradict the code
Most comments are as per the code when the code is written; but once the testing is
done, the program gets changed, the code changes in that series, but the comments
are left out. In such a case, the comment differs from the actual code.
Rather, comments should not only agree with the code but they should also
support the code. In the following code, the comment talks about new lines; but the
code talks of blank spaces to be put.
UJNFOPX
TUSDQZEBUFDUJNFOPX
HFUSJEPGUSBJMJOHOFXMJOFDIBSBDUFSDPQJFEGSPN
DUJNF
J
XIJMFEBUF<J>AAJ