Skip to content
Shelf

The public shelf

A library for prompts you reuse. Write them, version them, test them, and keep the ones that work. Copy one as it is, or fork it and make it yours.

1 prompt · Clear filters

Explain unfamiliar code in plain English

A walkthrough of what a piece of code does, why it is written that way, and what to watch out for before changing it. Pitched at your experience level.

Explain the code below so I could confidently change it.

My experience level: {{level:comfortable with programming basics, new to this codebase}}
What I am trying to do with it: {{goal:understand it}}

Structure your answer like this:
1. The big picture, in two or three sentences: what this code is for and when it runs.
2. Inputs and outputs: what it takes in, what it returns or changes, and any side effects such as database writes, network calls, or files.
3. A walkthrough in the order the code runs. Group lines into steps and explain each step, not each line.
4. Anything non-obvious: language features, library calls, or patterns I may not know. Explain each in a sentence or two.
5. Why it is probably written this way, where that is not obvious.
6. Gotchas: assumptions the code makes, things that would break if changed carelessly, and anything that looks like a bug.

Rules:
- Use plain words. When you have to use a technical term, define it the first time.
- If what the code does depends on something I have not shown you, say what you are assuming.
- Do not rewrite the code unless I ask.

Code:
{{code}}
Daniel Okafor · Coding