Skip to content

Writing & documentation overview

↑

Documentation is useful when someone can return to it months later and still understand the decisions behind the code. That person might be a teammate, a reviewer or your future self.

Before writing, ask what the reader needs to accomplish. A page called “How to handle collisions in Unity” is easier to navigate than a page called “Things I learned today”. Put the answer near the top, then show the reasoning and limitations.

Good code comments

Explain why a decision exists, what assumptions the code makes and what could surprise the next reader.

Helpful technical guides

Describe prerequisites, show a small working example and tell the reader how to verify the result.

  1. Quick overview. State what this page helps with in one or two sentences.
  2. Detailed explanation. Show the mechanism and why it matters, using a concrete example.
  3. Code and examples. Use labelled source languages and explain what readers should expect to see.
  4. Common mistakes. Describe failure modes and edge cases with practical guidance.
  5. Verification. Tell the reader how to check that the result is correct.
  6. Further reading. Link to reliable primary documentation and related topics.

A short overview helps readers decide whether they need the page. The in-depth section helps when they do. Neither should be missing. Include working examples with assumptions, not just syntax without context.

Explore writing code comments or structuring documentation for specific patterns.