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

Fill in the details

Paste the exact code you want explained. Include imports or dependencies if they are part of the snippet.

Helps tailor the technical depth and jargon usage. Leave blank for a standard intermediate explanation.

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

  1. Fill in the fields above. Required ones are marked with *.
  2. Check the prompt preview: your answers appear highlighted in place.
  3. Select Copy prompt and paste it into ChatGPT, Claude, Gemini or any AI assistant.
See all Software Development & Coding prompts