What Happens When You Type a URL and Press Enter
DNS lookups, TCP and TLS handshakes, HTTP requests, servers, and the browser's rendering pipeline. The whole journey of a web page, explained so it finally clicks.
Read →A great README, useful code comments, decision records and API docs that stay current. Practical templates and habits for documentation that saves time instead of going stale.
Everyone wants good documentation and almost nobody wants to write it. The result is familiar: a README that says "TODO," setup steps that stopped working two years ago, and knowledge that lives only in one person's head. Good documentation doesn't have to be long. It has to answer the questions people actually have, and stay true.
Different readers need different documents:
| Reader | Needs |
|---|---|
| New developer | How to install, run, test and deploy |
| Teammate changing code | Why things are the way they are |
| API consumer | Endpoints, parameters, examples, errors |
| Future you | Context you'll definitely forget |
Write each document for one audience. Mixing them produces documents that serve nobody well.
A good README answers, in order:
.env.example). (Config best practices.)A template:
# Invoice Service
Generates and emails PDF invoices for completed orders.
## Requirements
- Node.js (version in .nvmrc)
- Docker (for the local database)
## Getting started
```bash
cp .env.example .env
docker compose up -d db
npm ci
npm run migrate
npm run dev
```
## Tests
`npm test` runs unit and integration tests.
## Deployment
Merges to `main` deploy automatically via GitHub Actions.
The test of a good README: can a new developer go from clone to running app without asking anyone? Try it on a fresh machine, or ask the next new teammate to note every step that confused them.
// Bad: restates the code
// loop through users
for (const user of users) { ... }
// Good: explains a non-obvious reason
// The CRM rejects batches over 100 records, so we send in chunks.
for (const batch of chunk(users, 100)) { ... }
Good comments capture intent, trade-offs, workarounds and links to the issue or documentation behind a decision. If code needs a comment to explain what it does, try clearer names first. (Clean code tips.)
An ADR is a short document recording a significant decision:
# 007: Use PostgreSQL for the main database
## Status
Accepted
## Context
We need relational data with transactions for orders and payments...
## Decision
Use PostgreSQL with a managed provider.
## Consequences
+ Strong consistency, mature tooling
- Team needs to learn connection pooling for serverless functions
ADRs answer the question every new developer eventually asks: "Why on earth did we do it this way?" Keep them numbered in a docs/adr folder. They're short, they never need updating (you write a new one to supersede an old one), and they're invaluable a year later.
For APIs, generated documentation from an OpenAPI specification is hard to beat: it stays close to the code, shows every endpoint and schema, and offers interactive testing. Add what generators can't:
Documentation that lives far from the code (a forgotten wiki page) goes stale quickly. Docs as code means:
Documentation sprints produce docs that rot. Instead, write a little as you go:
What the project does, how to install and run it, how to test it, how it's configured, how it's deployed and where to find more documentation.
A short document capturing an important technical decision: its context, the decision itself and its consequences. It explains why the system is built the way it is.
Keep docs in the repository next to the code, update them in the same pull requests as code changes, and delete or fix outdated content as soon as you notice it.
DNS lookups, TCP and TLS handshakes, HTTP requests, servers, and the browser's rendering pipeline. The whole journey of a web page, explained so it finally clicks.
Read →There are dozens of HTTP status codes, but about fifteen cover nearly everything. What each one means, when to return it, and the mix-ups (401 vs 403, 301 vs 302) that confuse everyone.
Read →A, AAAA, CNAME, MX, TXT and NS records in plain English, why DNS changes seem slow, and the troubleshooting commands that tell you what is really going on.
Read →