Skip to content

Comments as Deodorant

Read the need for an explanatory comment as a diagnostic signal, not a virtue — a clear paragraph explaining a confusing function masks a retirable design problem instead of fixing it, so do the rename or split that retires the comment rather than maintaining it.

Core Idea

Comments as deodorant is the maintainability pathology in which a comment is used to explain confusing code rather than to fix its confusingness — masking a design problem instead of retiring it. The prose makes the smell locally invisible to review, leaves the underlying structure (poor naming, mixed responsibilities, a magic number) fully exposed to future change, and muffles the very confusion that would have triggered a refactor. It is maintenance debt, not retirement: unsynced, untestable, non-propagating. Named in Martin's Clean Code and Kernighan and Plauger's The Elements of Programming Style.

Scope of Application

The concept lives across the code-quality and maintainability subfield of software engineering, recurring scale-invariantly wherever a checkable surface exists to push prose onto.

  • Comments compensating for poor naming — the textbook case, retired by a self-describing rename.
  • Docstrings compensating for mixed responsibilities — a "does A then B unless D" header, retired by splitting the function.
  • Magic-number commentssleep(86400) # one day, retired by extracting a named constant.
  • Warning comments for unsafe coupling — "don't call before init()" that a type or API should enforce.
  • Dense regex/SQL one-liners — propped up by prose, candidates for decomposition.
  • README- and wiki-as-deodorant — long docs mapping to an architectural refactor never done.

Clarity

Naming this pattern inverts the intuition that more comments mean better code. It reframes the need for an explanatory comment as a diagnostic signal — evidence of an unretired design problem, not good practice — and shows the comment actively conceals the confusion by making the fragment read as documented and acceptable. It also sharpens two distinctions "documentation" blurs: what comments (usually deodorant) versus why comments (legitimate), and the checkable surface (compiler, types, tests) versus the human-only surface.

Manages Complexity

The maintenance pathologies covered look heterogeneous — drifting comments, obsolete rationale, propped-up one-liners, must-read READMEs — across scales from a variable to an org wiki. The pattern collapses that spread to one diagnosis (an explanatory overlay on a retirable structural problem) and one intervention family (do the structural fix, then re-evaluate what prose remains). The analyst tracks one axis per passage — is load-bearing information on the checkable surface or the human-only one — and reads the prescription off it by branch.

Abstract Reasoning

The pattern licenses diagnostic-from-need reasoning (read the presence of prose as a symptom of unretired structure), surface-classification (sort where a change's maintenance cost lives, resolving what-versus-why by branch), interventionist reasoning (a single fixed remedy family, predicting the comment shrinks as structure absorbs it), and meta-level boundary-drawing that fixes this as a response to other smells, recurring identically at every scale.

Knowledge Transfer

Within software engineering the pattern transfers as mechanism across scales, the diagnosis being scale-invariant — from a variable comment to an org wiki to an incident post-mortem, the diagnostic, surface classification, what-versus-why test, and remedy family all carry intact. Beyond software it is a shared abstract mechanism strong enough to be its own candidate prime, explanatory_overlay_masking_structural_debt, with genuine co-instances in law, organisations, pedagogy, and bureaucracy. The software cargo — the compiler/type/test surface, the concrete refactorings, the Clean Code lineage — stays home; carry the parent, not this name.

Relationships to Other Abstractions

Local relationship map for Comments as DeodorantParents appear above the current abstraction, mutual partners to the right, and children below. Node labels state whether each abstraction is prime or domain-specific; colors identify relation types.Comments as DeodorantDOMAINPrime abstraction: Explanatory Overlay Masking Structural Debt — is a decomposition ofExplanatory Ove…PRIMEDomain-specific abstraction: Code Smell — is a kind ofCode SmellDOMAIN

Current abstraction Comments as Deodorant Domain-specific

Parents (2) — more general patterns this builds on

  • Comments as Deodorant is a kind of Code Smell Domain-specific

    Comments as Deodorant is the meta-level code smell in which explanatory prose suppresses the visible trace that should have triggered structural investigation and refactoring.

  • Comments as Deodorant is a decomposition of Explanatory Overlay Masking Structural Debt Prime

    Comments as deodorant is the code-specific case where an explanatory overlay makes structural confusion locally tolerable and delays its repair.

Neighborhood in Abstraction Space

Comments as Deodorant sits in a moderately populated region (43rd percentile for distinctiveness): it has near-neighbors but no dense thicket of look-alikes.

Family — Software Decay & Debugging (10 abstractions)

Nearest neighbors

Computed from structural-signature embeddings · 2026-07-12