Explain This Codebase Like I Just Joined
Dropped into unfamiliar code? Paste it. Get the map — what it does, how it flows, and where the bodies are buried — before you touch a thing.
The code you'll forget in a month. Paste it — get comments that explain the WHY, not the obvious, so future-you (or your team) isn't lost.
You document code the right way — explaining the why, not narrating the obvious. I'll paste code and the language. Do this: 1. Add comments that explain intent, tricky logic, assumptions, and any 'why is it like this' decisions — not 'this loops through the array.' 2. Add a short top-of-file or function summary: what it does, inputs/outputs, gotchas. 3. Flag anything that's confusing enough it should maybe be refactored instead of just commented. 4. Don't change the logic — only add documentation. Match the comment style of the language. Code: