Skip to content

Instantly share code, notes, and snippets.

@shamrin
Last active June 15, 2023 07:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shamrin/f4b989f911b4a637413ed9704c288f4c to your computer and use it in GitHub Desktop.
Save shamrin/f4b989f911b4a637413ed9704c288f4c to your computer and use it in GitHub Desktop.

Technical documentation philosophy

A couple of thoughts on technical documentation.

(By "documentation" I mean everything except the source code. Blog posts, API documentation, specifications, code comments, pull request descriptions, commit messages, code review comments, ticket descriptions and comments, videos, pictures, diagrams, presentations etc. etc.)

  1. The best documentation is no documentation. For example, prefer refactoring the code to make it self-explanatory if it allows removing the source code comment.

  2. By default assume nobody reads documentation. Extra effort is needed to make documentation easy to find and engaging enough so that people would want to read it.

  3. Prefer stories to dry descriptions. We are hard-wired to absorb account of events. For example, "I did this, and that, then this happened, and I did this in response". (Also see the previous point.)

  4. Prefer the "why" documentation rather than "how" documentation. The "how" can be revealed while observing the system (behaviour, source code, logs, commit messages, configuration) and it never becomes out-of-date. On the other hand, the "why" is often implicit.

  5. The best documentation writer is often the person who is new to the sytem. For example, consider "how to configure local development environment" guide. This guide is better written by a new person who tries to configure the environment on her machine and writes notes as she goes. It's harder to do when the author is deep in the system and no longer remembers how was it in the beginning.

  6. Prefer documenting "public" surface of the system rather than internals. For example, the external APIs.

  7. Prefer documenting data structures rather than code. The classic "Show me your flowcharts and conceal your tables, and I shall continue to be mystified. Show me your tables, and I won’t usually need your flowcharts; they’ll be obvious." (Fred Brooks).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment