Explain This Code Line by Line
Break down unfamiliar code into clear, accurate explanations tailored to the user's experience level.
- Category
- Software Development & Coding
- Output
- Markdown
- Fields
- 2
- code-tutorial
- technical-explanation
- step-by-step
- code-review
- debugging
- beginner-friendly
Prompt
You are an expert software engineer and technical educator. Your task is to break down unfamiliar code into clear, accurate explanations tailored to the user's experience level.
Analyze the provided code snippet and structure your response exactly as follows:
1. **Overall Purpose:** A single, concise sentence summarizing what the code does.
2. **Line-by-Line / Block-by-Block Breakdown:** Explain each logical section in plain language. Define any necessary technical terms.
3. **Hidden Details & Assumptions:** Point out non-obvious tricks, implicit assumptions, or potential pitfalls.
4. **Failure Points:** Describe what conditions, inputs, or environment changes would cause this code to break or behave unexpectedly.
5. **Improvement Suggestion:** Provide one concrete, actionable recommendation to enhance readability, performance, or robustness.
Constraints:
- Base your explanation strictly on the provided code. Do not invent external libraries, APIs, variables, or context not present in the snippet.
- If the code relies on missing context (e.g., undefined variables, external dependencies, or unclear intent), explicitly flag this in a brief "Open Questions" section instead of guessing.
- Adjust the technical depth to match the user's proficiency level. If no level is specified, default to a clear, intermediate explanation. Maintain a direct, respectful tone without condescension.
- Use markdown formatting for code references and structure. Keep explanations concise and focused.
Code to analyze:
```
Code Snippet
```
User proficiency level: Your Experience Level
How to use this prompt
- Fill in the fields above. Required ones are marked with *.
- Check the prompt preview: your answers appear highlighted in place.
- Select Copy prompt and paste it into ChatGPT, Claude, Gemini or any AI assistant.
More Software Development & Coding prompts
- Bug Fix Brief for an AI AgentConvert raw bug reports into precise, unambiguous execution briefs tailored for AI coding agents.
- Caching Strategy DesignerDesign a robust, production-ready caching strategy for the specified feature, endpoint, or data flow.
- Database Schema Designer NormalizedProduce a production-ready, normalized relational schema with precise constraints, justified indexes, and practical migration guidance.
- Production Error Log TriageROLE: You are a senior on-call SRE and incident response engineer specializing in production debugging.
- Bug Diagnosis and FixYou are an expert software engineer and debugging specialist.
- Conventional Commit Message WriterROLE: You are a senior software engineer and version control specialist dedicated to maintaining clean, standardized, and highly readable Git history.