Quality & Team

Documentation as Code

Foundational

Documentation kept apart from the code goes out of date, because nothing forces it to keep up. Treat docs like code: in the repo, reviewed in the same PR, and versioned with what they describe. Then they stay correct. Write the docs that are worth keeping: the why behind decisions, the things that would surprise the next person, and how to run the system.

Documentation-as-code means docs are first-class artifacts. They are stored in version control next to the code, changed in the same pull request as the behaviour they describe, and reviewed for accuracy like any other change. Keeping them next to the code keeps them correct. A doc you must update to merge the change stays current, while a wiki page nobody has to touch slowly becomes wrong.

Be deliberate about what to document. Code shows what and how. Comments and docs should capture why: the reason, the trade-off, the non-obvious constraint, and the regulatory reason something works the way it does. Clear code (good names, small functions) removes the need for much explanation, so your writing can focus on what the code cannot express.

Keep docs close and current

Write what earns its keep

What, not why, and a leaked secret // set the timeout to 30000
client.Timeout = 30000;
// example config: ConnectionString = "Server=...;Password=Prod123!"

The comment repeats the obvious and explains nothing, and the README example leaks a real production password. Worse than no docs on both counts.

The why, no secrets // Sumsub p95 is ~12s under load; 30s gives headroom before we
// fail closed and escalate, rather than timing out on a slow-but-valid check.
client.Timeout = TimeSpan.FromSeconds(30);
// example config uses a Key Vault reference, never a real secret

The comment captures the reasoning a future maintainer needs, and the example shows the secure pattern instead of leaking a credential.

Self-review checklist

Why it matters: Knowledge that is not written down lives only in people's heads and leaves when they do. That is a direct operational risk on a regulated platform. Docs kept as code stay accurate because the workflow forces it. They preserve the reasons and the run-knowledge that let the team, and the next hire, operate safely without the original author present.