Black Friday: 40% off ThatPrompt. $23.40 instead of $39, until 30 November. Get the deal

ThatPrompt

Prompt to explain unfamiliar code

Get a walkthrough of code you didn't write that covers what it does, how data moves through it, what's surprising, and where it's safe to change.

Category
Coding
Tags
Explaining
Added
Added

Fill in the prompt

The prompt below changes as you type, and Copy prompt copies it filled in. What you type stays in this browser. Leave a box empty to fill it in after you paste.

The prompt

Explain the code below to me. My background: {{background}}

{{code}}

Structure the explanation like this:
1. Purpose: what this code is for, in two sentences.
2. Walkthrough: follow one realistic input from where it enters to where it leaves. Name the functions it passes through.
3. Key ideas: any pattern, library feature or language construct I may not know, explained in a line or two each.
4. Surprises: anything that looks wrong, unusual or fragile, and why someone might have written it that way.
5. Where to change it: if I needed to change its behaviour, which parts are safe to touch and which would break other things.

Don't explain it line by line. Skip anything obvious to someone with my background. Quote the code you're talking about so I can find it.

Replace each {{highlighted part}} with your own text before you send it.

How to use it

Fill {{background}} with what you already know, so the explanation skips that and spends its time on the rest. "Backend developer, strong in Java, new to Kotlin coroutines" gets a very different answer from "first week learning Python".

Put the code in {{code}}. A whole file is fine. If it calls into other files, add the signatures of those functions too, or the model will describe what it imagines they do.

Example for {{background}}: "Comfortable with React, never used Redux Saga."

The walkthrough follows one input through the code instead of reading it top to bottom, which is how a colleague would show you at a whiteboard. The surprises section is where old code gives up its secrets: the workaround for a bug fixed years ago, or the check that looks pointless until you remove it.

All coding prompts