# Explain what a piece of code does

Plain-language walkthrough of unfamiliar code: purpose, flow, key parts, and gotchas.

- Topic: Software Development
- Framework: RTF
- Level: Standard
- Tags: Coding, Explain & Teach, Code, Fill-in Template
- Source: https://www.thinkwithprompt.com/prompts/explain-what-a-piece-of-code-does

## Prompt

```text
Explain this code to me.

**My level:** [beginner / comfortable with another language / experienced developer new to this codebase]
**Language/framework:** [LANGUAGE]
**Code:**
[PASTE CODE]

Explain:
1. **Purpose** — what it does, in 2–3 sentences.
2. **Walkthrough** — section by section, in execution order.
3. **Key concepts** used (patterns, language features, libraries), explained for my level.
4. **Inputs, outputs, and side effects.**
5. **Gotchas** — bugs, edge cases, performance or security concerns you notice.
6. **Questions to ask** the author, if anything is unclear or looks unintentional.

Don't rewrite the code unless I ask.
```

## What to fill in

- LANGUAGE
- PASTE CODE

Free to copy and use. From ThinkWithPrompt (https://www.thinkwithprompt.com/), a library of 2,663 curated AI prompts.
