Goal
Explain the code below so the reader understands what it does, how data moves through it and which parts are risky to change.
Inputs
- Language and framework: [e.g. Go 1.22, or JavaScript with React]
- Reader's level: [beginner, comfortable in another language, experienced]
- Why they are reading it: [fix a bug, add a feature, review, learn]
- Code: [paste the code here]
Steps
- Summarise the purpose in two or three sentences before any detail.
- Split the code into logical blocks, not single lines, unless a line is dense.
- For each block, explain what it does and why it is likely written that way.
- Trace one realistic input from entry to output.
Output format
- Summary: what the code does and where it probably fits in a larger system.
- Walkthrough table:
| Lines | What it does | Why it matters |
- Data flow: a numbered trace of one example input through the code.
- Terms explained: language features or patterns a reader at the stated level may not know, one line each.
- Watch out: parts that look simple but are easy to break, such as shared state or side effects.
- Questions to ask the author: anything the code alone cannot explain.
Check before answering
- Line numbers match the pasted code.
- Explanations match the reader's level; no unexplained jargon for beginners.
- Guesses about intent are labelled as likely, not stated as fact.
- No rewriting of the code unless a bug is found; bugs are listed separately.
- The summary can be understood without reading the rest.






