Documentation that nobody reads is useless. Here is how to write the useful kind.
Types of Documentation¶
- Tutorial — teaches (step by step)
- How-to guide — solves a problem
- Reference — technical detail
- Explanation — explains concepts
Principles¶
- Write for the reader, not for yourself
- Concrete examples > abstract explanations
- Short sentences, short paragraphs
- Code that works (not pseudocode)
- Keep it updated — outdated documentation is worse than none
Structure¶
- Why — motivation and context
- What — what it does / solves
- How — step by step with examples
- Reference — API, config, parameters
- Troubleshooting — known issues
Tools¶
- Markdown + Git — simple, versioned
- MkDocs / Docusaurus — static site generators
- Notion / Confluence — for internal docs
- OpenAPI/Swagger — for API documentation
Docs as Code¶
Version your documentation in Git alongside the code. Review in PRs. CI/CD for publishing. Code and docs evolve together.
Test¶
Give the docs to a new developer. Can they get up and running from them? If not, improve them.
documentationwritingbest practices