R87 Write no history in a code comment

On by default

Write no history in a code comment: not what was tried, reverted or discussed, nor why another way was not taken.

Reason

How the code came to be is already recorded where it happened: in the commit messages, the pull requests and the decision records. Written again in a comment, it is a second copy of a fact that belongs in one place (Art. VIII §5), and it reads as true of the code long after the code has moved on.

Verification

History is what a comment says about earlier versions of the code or about how it was decided: an approach tried and dropped, a revert, a review discussion, who asked for the change, or why an alternative was rejected. A comment that says why the code is as it is now, in terms of the code and its requirements, is not history, even when the reason was found by trying.

Violated when a change adds a code comment, a docstring included, that holds history.

Provisions of the constitution it cites

Relations

Parent
R83 Code
Requires
none
Conflicts with
none

Metadata

ID
87
Revision
2
Kind
rule
Status
trial
Slug
no-history-in-comments
Default level
project
Constitution revisions
>=1
Check
none
Default
on
Uses
Instructions instructions, Review review
Original language
English en
Translations
Chinese zh