|
|
|
|
|
by CyberFonic
5619 days ago
|
|
Someone once wisely said (wish I could remember who) that programs should be written for other humans to read and understand and only incidentally for compilers to translate. The program will be read a lot more by humans during it's lifetime than by compilers. Line by line comments can be hard to read. It helps to use clear naming, nouns for things, verbs for actions, spelling stuff out in full. I prefer block comments which only explain what isn't obvious in the code and what could not be expressed more clearly in the code. As for comments not agreeing with the code, that should get picked up during peer review. Of course, the best comprehension test is when you come across the code a year later to make some change. |
|