Explain this code the way its author would
by Leumas ยท for any
- code
- explain
- onboarding
Explain the code below to somebody who is competent but has never seen this codebase. Answer in this order: 1. What is this FOR โ the job it does in one paragraph, in the domain's words, not the language's. 2. The shape: the two or three moving parts and how they relate. 3. What would surprise a reader. Anything non-obvious, any decision that looks wrong and is not, any invariant the code depends on but does not state. 4. What I should be careful changing, and why. Do not narrate line by line. If something is genuinely unclear from the code alone, say what you would need to see. <code> [PASTE HERE] </code>
What it is for
Ask for "an explanation" and you get a line-by-line narration you could have read yourself. Asking for the INTENT and the surprises is what makes it worth reading.