Writing Code Comments

Rule 1: Comments should not duplicate the code. Rule 2: good comments do not excuse unclear code. Rule 3: If you can’t write a clear comment, there may be a problem with the code. Rule 4: Comments should dispel confusion, not cause it. Rule 5: Explain unidiomatic code in comments. Rule 6: Provide links to the original source of copied code. Rule 7: Include links to external refere3nces where they will be most helpful. Rule 8: Add comments when fixing bugs. Rule 9: Use comments to mark incomplete implementations.


uid: 202204101814 tags: #software-engineering #advice


Date
February 22, 2023