Prompts / Studying & Academic Writing

ChatGPT prompt for learning programming

This prompt creates an adaptive programming lesson that makes you reason, write code, test it, and explain it back. Use it when you want help learning a concept instead of receiving a finished solution you cannot maintain.

PromptOpen ChatGPTOpen Claude
Teach me programming as a patient technical mentor. My goal is to build understanding and debugging habits, not to copy a finished answer. Do not assume knowledge beyond what I list, skip prerequisite concepts, or write the full solution before giving me a chance to attempt it.

What I want to learn or build: [LEARNING GOAL]
My current experience and languages: [CURRENT LEVEL]
My environment and tools: [ENVIRONMENT]
Time available and preferred pace: [TIME AND PACE]
A project, exercise, or code I am working with: [CURRENT WORK]

Ask up to 3 clarifying questions only if a required input is missing. Then create one focused lesson of 45–60 minutes with this structure:

1. Learning target: one observable skill I should demonstrate by the end.
2. Prerequisite map: up to three concepts I need first, marking which I already know versus need explained.
3. Plain-language explanation: 200–350 words, followed by a tiny annotated example that uses only concepts introduced so far.
4. Guided practice: three increasingly difficult exercises. Give the problem, inputs/outputs or acceptance criteria, and one hint at a time. Do not reveal a solution unless I ask after attempting it.
5. Debugging practice: provide one plausible broken snippet related to the lesson, the error or wrong behavior, and a diagnostic process using observation, hypothesis, and a minimal test.
6. Mastery check: five short questions, including one “predict the output” and one “explain why.”
7. Next session: a small build task and the exact evidence I should bring back.

When I share code, first identify the smallest reproducible problem and explain the cause before proposing a fix. Self-check before answering: ensure every exercise can be solved with the concepts you taught, and label any environment-specific command or assumption.

Fill in

PlaceholderWhat to enterExample
[LEARNING GOAL]State the programming concept, language feature, or small project outcome you want to learn.Learn JavaScript array methods well enough to transform API results into a simple list for a web page.
[CURRENT LEVEL]Describe what you already know, including languages used and concepts that still feel unclear.I know variables, functions, if statements, and basic loops. map, filter, and reduce blur together for me.
[ENVIRONMENT]List your operating system, editor, runtime or compiler version, and any framework or course constraints.macOS, VS Code, Node.js 22, plain JavaScript; no framework yet.
[TIME AND PACE]Say how much time you have and whether you prefer a slow conceptual lesson or a project-oriented session.I have 50 minutes and prefer examples first, then short exercises I can run locally.
[CURRENT WORK]Paste a small code sample, error message, exercise prompt, or say that you are starting from scratch.Starting from scratch, but I want to work with an array of objects containing title, completed, and priority.

How to use

  1. Replace the inputs with one narrow goal; “learn Python” is too broad, while “write and test a function that parses dates” is workable.
  2. Attempt each exercise before requesting a solution, then paste your code and the exact output or error you saw.
  3. Ask: “Review my attempt using hints only; do not show corrected code unless I ask.”
  4. At the end, answer the mastery questions without looking back and save any errors that still confuse you for the next lesson.

Variations

Debug my code

Use this when you are stuck on a specific error or incorrect behavior.

Variation
Coach me through debugging this programming problem without immediately rewriting my code. Goal and expected behavior: [GOAL]. Code: [CODE]. Exact error or actual output: [ERROR OR OUTPUT]. Environment and versions: [ENVIRONMENT]. First restate the smallest reproducible problem, then give me one diagnostic step at a time. Explain what each observation would mean. After I report results, help me form the next hypothesis. Do not invent logs, APIs, files, or environment details. Only show a minimal fix after explaining the root cause.

Project learning plan

Use this before beginning a first real project.

Variation
Create a learning-first plan for building [PROJECT]. My current skills: [SKILLS]. Tech constraints: [CONSTRAINTS]. Time available: [TIME]. Features I want: [FEATURES]. Break the work into 6–10 milestones, each with a learning objective, small deliverable, acceptance test, likely pitfall, and prerequisite. Mark features to postpone from version one. Do not choose tools based on hype; explain each choice in terms of my current level and project requirements. Flag missing requirements that prevent a sound plan.

Code review lesson

Use this to learn from code you wrote or inherited.

Variation
Review this code as a teaching exercise. Code and language: [CODE]. What it should do: [INTENT]. My experience level: [LEVEL]. Constraints or style rules: [CONSTRAINTS]. Explain the code's control flow first, then identify the three most important improvements in correctness, readability, or maintainability. For each, show the risk, ask me to predict the consequence, and provide a small revised excerpt only after the explanation. Do not criticize stylistic differences as defects or invent requirements not present in my notes.

Tips

  • Choose one behavior you can demonstrate by the end of a session, such as parsing a string or writing a test, instead of trying to absorb a whole language topic.
  • When debugging, preserve the exact error text and reduce the code until the failure remains; a small reproducer teaches more than a large pasted project.
  • Ask the model for prediction questions before running code. Explaining what you expect reveals misunderstandings that a copied fix hides.
  • Run generated commands only after checking that they match your operating system, language version, and project package manager.

FAQ

Will AI help me learn programming if it writes the code for me?

It can help, but copying full solutions often hides the reasoning. Use hints, small exercises, and explanation checks before requesting a reference solution.

How much code should I paste when I am stuck?

Paste the smallest file or function that reproduces the problem, plus the exact error and expected behavior. Remove secrets, API keys, and unrelated files.

Can I use this prompt for a framework such as React or Django?

Yes, but include the framework and version, your runtime, and the specific feature you are learning. Framework commands and APIs can differ substantially by version.

Related prompts

All Studying & Academic Writing prompts →

Get a few prompts like this every week

Something Big is a free AI newsletter read by 50,000+ professionals. About three short emails a week with prompts and tools that work, plus what changed in AI and what to do about it.