Why I Love Documentation (And Why You Should Too)
When you have features to build, bugs from months ago to fix, and that one production issue that's been occupying you for the last two weeks, writing documentation feels like time you don't have.
But I've learned that documentation is actually one of the most important parts of the job and should be prioritised.
I've spent way too many hours debugging code built months ago, wasted entire days trying to figure out projects from previous developers who left zero breadcrumbs to follow. I've been the new person on teams where the unofficial onboarding process was "just look at the code".
Even worse, I've spent countless hours digging through forums and documentation for third-party tools, trying to debug issues that turned out to be undocumented legacy bugs. In some cases, it would have been easier to build a custom solution from scratch when you factor in all the time wasted purely because of relying on code that had no proper documentation.
Bad documentation, or lack thereof, is extremely expensive. It costs time, sleep, productivity, and sanity. And honestly, it makes you look like you don't care about the people who come after you or the ones you're working with.
It really doesn't have to be that way. Here's what I've learned about writing documentation that actually helps me (and might help the future you).
Foundation: Assume Your Audience Knows Nothing About It
This one sounds simple, but I have seen so many documentations starting in medias res, including some of my own. Now I imagine I am explaining things to someone familiar with the context but completely clueless about the setup.
Structure: Start With The Basics
I rely on my documentation to answer these main questions in order:
1. What is it? A simple summary that explains the purpose
2. Why does it exist? The problem it solves or the need it fills
3. What do I need to know first? Prerequisites, dependencies, assumptions, background knowledge
4. How do I use it? The basic workflow or main use cases, with examples
5. What are the details? The specifics, edge cases, warnings, known bugs and limitations
This format has served me well, as it covers both the big picture, and the how-tos. Different people learn and understand things differently, this way you will not lose anyone along the way.
Always include any prerequisites and assumptions. Don't make people guess what they need to know. If your tool requires Docker, say so. If it assumes knowledge of REST APIs, mention that.
Organization: Separation of Concerns
The entirety of your documentation doesn't have to live in a single file. If you think of it like code architecture, each piece should have a clear purpose and responsibility.
It might help to break down your documentation into smaller modules that are easier to digest, and maintain.
Some essential sections to consider:
- Overview What it does, why it exists
- Quick Start Get it up and running in the most common scenario
- How-To Guides Instructions for tasks
- Technical Details Explanations of how things work internally
- API References Endpoints, parameters, responses
- Troubleshooting & FAQs Common problems and solutions
- Architecture How everything fits together
Always remember to link everything together. Create a directory of connected documents that guide people through your system. Include links to:
- Related internal documentation
- External tools and libraries used
- GitHub issues
- Stack Overflow answers
- Official documentation for any third-party services
DO NOT document external dependencies.Just explain how you use them and link to the official docs. Your documentation should be compact and focused on what is unique to your environment.
Beyond Words: Making Documentation Accessible
We already mentioned how people learn differently when it comes to structure and organization. Where it also matters is in the format and presentation of your content. Ideally, your documentation goes beyond just use of words.
Code examples. Don't just show the function, show it in use. Include the imports, the setup, the expected output. Even better, make your examples easy to copy and run.
Screenshots and recordings. A 30-second screen recording of your setup process can save hours of back-and-forth questions for users, and yourself. Screenshots of outputs can also be very helpful to verify if on the right track.
Diagrams and flowcharts. This one is my personal favorite. Sometimes a simple diagram explains architecture better than paragraphs of text. Even a simple hand-drawn sketch can clarify complex relationships with ease.
Templates and starters. Instead of describing the ideal configuration, offer it as a template. This gives a working starting point anyone can modify rather than build from scratch.
Outputs and error messages. Show what success looks like and what common errors look like. When someone sees an error, they should be able to quickly identify if it's expected or not.
Reality Check: Traps I Keep Falling Into
Even after writing many different documentations, I still catch myself checking for and correcting these mistakes:
- I assume people know what I know. I'll use internal terminology without explaining it first. Always define acronyms and domain-specific terms on first use. Create a documentation-specific glossary if necessary
- I skip the sad path. I document the perfect scenario but forget to mention what happens when things go wrong. Always include error cases and recovery steps.
- I don't explain the "why". I show how to do something but forget to explain why it's necessary. Context helps.
- I don't test my own instructions. I write steps from memory instead of actually following them. Always test your documentation.
- Perfectionism paralysis. I delay publishing until it's comprehensive and complete enough. Meanwhile, people are struggling without having answers to the most basic questions. Basic documentation is better than perfect.
My Template
Here is my structure that you can use and adapt to your own.
# Project Name
Simple description that explains what this does and why it matters
## What is it?
Answers to:
- What does the project do?
- Who should use it and when?
- What problems does it solve?
## Prerequisites
Before you start, make sure you have:
- **XYZ** (v2 or higher)
- Basic knowledge of [...]
- Access to [...]
## Quick Start
Simple, most basic instructions to get it up and running.
### Clone the repository
git clone https://github.com/username/project-name.git
cd project-name
### Install dependencies
npm install
### Start the development server
npm run dev
### Visit http://localhost:8080
You should see [...].
## Installation & Setup
### Development Environment
#### Clone and install dependencies
git clone https://github.com/username/project-name.git
cd project-name
npm install
#### Set up environment variables
cp .env.example .env
# Edit .env with your configurations
#### Run the application
npm run dev
### Deployment
[Link to deployment guide]
## Usage examples
### Basic Usage
const example = new ExampleClass();
example.doSomething();
// Output: [...]
### Advanced Examples
const config = {
option1: 'value',
option2: true,
option3: 2
};
const example = new ExampleClass(config);
const result = example.complexOperation();
console.log(result);
// Output: [...]
## Technical Details
Explanation of how the project works internally, or link to a separate documentation.
## Architecture
Overview of how components fit together, or link to architecture documentation.
## How-To Guides
- [Link to task guides]
- [Link to configurations]
- [Link to examples]
## Troubleshooting
### Common Issues
#### Error: "..."
Check if [...]
Verify your [...]
#### Slow Performance
Try [...]
Check if [...]
#### Getting Help
- Link to the FAQ
- GitHub issues
- Link to forum
## Links & Resources
- Link to API References
- Link to third-party Documentation
Bottom Line
You need documentation, and it will save you time. I've learned this the hard way.
It doesn't have to be perfect, or comprehensive and complete. Having basic answers to the most common questions is far better than having nothing at all, or something so complex nobody uses it. Any documentation will help you and others.
Start simple, answer basic questions, let it grow naturally over time.
Monday, 14 July 2025