The Underrated Value of Documentation
Code is read much more often than it is written.Good documentation is an act of empathy for your future self and your team.In a remote world, documentation is the oil that keeps the machine running.
The "Bus Factor"
If your lead engineer wins the lottery tomorrow and moves to Fiji, does your startup die ? If the answer is "yes"(or even "maybe"), you have a documentation problem.Knowledge that lives in heads is temporary.Knowledge that lives in docs is persistent.
The Lie: "Code is Self-Documenting"
We've all said it. "Just read the code." But code only tells you HOW (the implementation) and WHAT (the logic). It rarely tells you WHY (the intent).
Why did we choose Redis over Memcached ? Why is there a setTimeout(..., 500) here? Why do we ignore errors from this specific API? Code cannot answer these questions. Documentation can.
The Diátaxis Framework
Not all docs are the same.A common mistake is dumping everything into a giant README.The Grand Unified Theory of Documentation(Diátaxis) splits docs into four quadrants:
1. Tutorials
Learning - oriented. "A lesson."
Example: "Build your first Todo App."
2. How - To Guides
Problem - oriented. "A recipe."
Example: "How to reset the production database."
3. Reference
Information - oriented. "A dictionary."
Example: API Endpoint definition parameters.
4. Explanation
Understanding - oriented. "A discussion."
Example: "Why we use Microservices."
ADRs: Architecture Decision Records
The most high - leverage documentation you can write is the ADR.It captures a decision at a point in time.
Structure of an ADR:
- Context: We need a database. PostgreSQL is stable, Mongo is flexible.
- Decision: We are going with PostgreSQL.
- Consequences: We get ACID compliance, but schema migrations will be harder.
Two years later, when someone asks "Why the hell did we pick Postgres?", you point them to ADR-004.
Docs as Code
Don't hide docs in Confluence or Google Docs where they go to die. Keep them in the repo (Markdown). Review them in PRs. If a PR changes behavior, it must update the docs. If the docs aren't updated, the test fails.Make documentation a first - class citizen of your CI / CD pipeline.
Conclusion
Writing is hard.But debugging a system you don't understand at 3 AM is harder. Invest in documentation now, and your future self will thank you.