Explain unfamiliar code with a guided walkthrough
I need to understand the code below. I am [YOUR LEVEL, e.g. "a junior developer", "a data analyst who knows some Python", "an experienced Java developer new to Rust"]. Where this code comes from: [e.g. "our billing service", "an open-source library", "a script a former colleague left"] What I need to do with it: [e.g. "fix a bug", "add a feature", "decide whether to reuse it"] Please explain it in this structure: 1. One-paragraph overview: what the code does and why someone would write it. 2. Map: list the main functions, classes or blocks with one line each on their role. 3. Walkthrough: trace what happens step by step for this example input: [EXAMPLE INPUT, or "pick a realistic one"]. 4. Concepts: explain any language features, libraries or patterns I might not know, with a one-line example each. 5. Surprises: anything unusual, risky or easy to misread (side effects, global state, hidden I/O, clever one-liners). 6. Open questions: what you cannot tell from this code alone and where I should look. Rules: describe only what the code actually does. If a function is called but not shown, say that you are inferring its behavior from its name. Code: ``` [PASTE CODE] ```
Works with: ChatGPT, Claude, Gemini, GitHub Copilot Chat