Documentation That Stays Fresh (Or How I Try)
January 27, 2025
•
2 min read
•
By Amey Lokare
🎯 The Problem
Documentation that's outdated is worse than no documentation. It misleads and wastes time.
✅ What Works
1. Documentation as Code
Keep docs in the repo, next to the code. When you change code, update docs in the same PR.
2. README-Driven Development
Write the README first. It forces you to think about the API and usage before coding.
3. Code Comments
Good code comments are documentation. They stay with the code and update together.
4. Automated Checks
CI checks that docs exist, links work, and examples run. Catch problems early.
⚠️ What Doesn't Work
- Separate docs: Docs that live elsewhere get forgotten
- Big docs: Long documents are hard to maintain
- Outdated examples: Examples that don't work are worse than none
- No process: Docs without a process get stale
💡 My Process
- Write docs with code (same PR)
- Keep docs close to code (in repo)
- Review docs in code reviews
- Update docs when changing code
- Delete outdated docs
🔄 When Docs Get Stale
It happens. When I notice stale docs:
- Update them immediately
- Or delete them if they're not needed
- Don't leave them outdated
💭 My Take
Good documentation is hard to maintain. But it's worth it. Keep docs close to code, update them together, and delete what's outdated.
Fresh docs are better than perfect docs. Keep them simple and current.