Recently, I was shown this quote. The person who showed it (in a general talk, not to me personally and specifically) is a smart person I respect, so I'm going to leave that person un-named. The authors of the quote, Kernighan and Plauger, are legends of the field. In 1979 (the very same year I was first paid to program) they wrote:
1. If a program is incorrect, it matters little what the documentation says.2. If documentation does not agree with the code, it is not worth much.3. Consequently, code must largely document itself. If it cannot, rewrite the code rather than increase the supplementary documentation. Good code needs fewer comments than bad code does.4. Comments should provide additional information that is not readily obtainable from the code itself. They should never parrot the code.5. Mnemonic variable names and labels, and a layout that emphasizes logical structure, help make a program self-documenting.
// Process the first 5 elementsfor(i = 0; i <= 5; i++){ ProcessElement(i);}
Click Start a FREE 10-Day trial