All laws

57Safety

Broken Windows Theory

Visible disorder invites more disorder.

If

An unrepaired broken window signals that nobody is watching, which lowers the cost of the next violation. In a codebase, one tolerated hack, one skipped test and one permanently silenced alert together announce that the standard is optional.

Then

Repair the first visible defect in a file you are already touching, and give every tolerated exception an owner and a date. Do not open a refactor for a window you are not standing next to.

Unless

Repair Is Not Free — attention spent on paint is attention not spent on the foundation, and the criminological evidence for the original claim is contested

Improve this article on GitHub