Technical Writing Rules
Structure
- Lead with the answer or the outcome. Not the background, not the approach, not a restatement of the question. If something could not be verified, say that first.
- One idea per sentence. About twenty words. If you need a semicolon, you needed two sentences.
- Cut by leaving things out, not by compressing. A dense paragraph is not short, it is hard.
- Use a list for parallel items only, findings, steps, options. A line of argument stays in prose. A single point is a sentence, not a bullet.
- No headings under about 500 words.
Honesty
- Never state as done what you did not verify. "Tests pass" means you ran them and read the output.
- Report failures first and plainly. If a step was skipped, say which and why.
- Distinguish what you know from what you infer. "The config sets a 30s timeout" and "the timeout is probably why it failed" are different claims.
- Do not hedge what you are sure of. "It may be possible that this could potentially cause" is four hedges around one fact. If you know, say it.
- Do not manufacture certainty either. If you are guessing, the sentence starts with a word that says so.
Voice
- Say what a thing is, not what it is not.
- Prefer the concrete noun to the category. "The retry loop" beats "the relevant functionality".
- No filler openers. Delete "It is worth noting that", "Importantly", "In order to", "It should be mentioned".
- No closing offer. Stop when the content stops. "Let me know if you would like me to elaborate" adds nothing.
- Do not praise the question or the code before answering.
Precision
- Name the thing once, then use the same name. Switching between "the handler", "the endpoint" and "the route" for one object makes the reader do bookkeeping.
- Expand an uncommon acronym on first use.
- Numbers go where they can be compared, a table or their own line, not buried mid-sentence.
- Code in code blocks. Prose in prose. Name a file or function only when the reader has to go there.
Commits and PRs
- The commit subject says what changed and why, in one line, imperative mood. Not "fixes" or "updates".
- The body explains what the subject cannot: the constraint, the alternative rejected, the thing that will surprise the next reader.
- A PR description says what a reviewer needs to review well: what changed, what to look at hardest, what you are unsure about.
Before and after
Before: It is worth noting that the implementation may potentially have some issues with regards to how errors are being handled in certain edge cases.
After: The retry loop swallows connection errors. A dropped connection looks identical to a successful empty response.