Learn to Code With AI: What a Study Found, and a Path

To go from vibe coder to engineer, learn to do four things without the AI doing them for you: explain code, read code, debug code, and know why a design is built the way it is. Keep using AI the whole way, but as a tutor that explains, not a typist that finishes the task. A 2026 randomized trial from Anthropic, which sells an AI assistant, found that people who coded with an AI assistant scored 50% on a quiz about what they had just built, against 67% for people who coded by hand. How they used the assistant mattered more than whether they did.
Does using AI make you a worse programmer?
Sometimes, and the study shows when. In January 2026 Anthropic (which sells an AI assistant) published a randomized trial of 52 software engineers, mostly junior, learning an unfamiliar Python library called Trio. Half coded two features with an AI assistant, half by hand, then all took a quiz on what they had just used.
The AI group averaged 50%, the hand-coding group 67%. Anthropic calls that “nearly two letter grades”, and it was statistically significant. The AI group finished about two minutes faster, which was not. The largest gap was on debugging questions (Anthropic’s write-up).
Using AI did not guarantee a low score. Anthropic grouped people by how they used it:
| How they used AI | People | Quiz score (about) | What they did |
|---|---|---|---|
| Generation, then comprehension | 2 | 86% | Generated code, then asked follow-ups until they understood it |
| Hybrid code and explanation | 3 | 68% | Asked for code and an explanation of it together |
| Conceptual inquiry | 7 | 65% | Asked only conceptual questions, wrote the code themselves |
| AI delegation | 4 | 39% | Had the AI write everything |
| Progressive reliance | 4 | 35% | Asked a question or two, then delegated all code writing |
| Iterative AI debugging | 4 | 24% | Used the AI to debug or verify, not to explain |
Read it with its limits: one library, one sitting, a quiz minutes later, groups of 2 to 7 people. Anthropic says its analysis “does not draw a causal link” between a style of use and a score. A strong hint, not a law. The per-group scores are read from the study’s chart, so treat them as approximate.
If you paste every error back until it goes away, you are doing what that last group did. There is a way out of that loop.
What should you do differently? Four rules drawn from it
Three follow from the table. The fourth is a habit that the study did not test.
- Ask why before you ask for more. After the AI writes something, ask what each part does and what would break if you deleted it. This is what the top-scoring group did, though it had only two people.
- Get stuck on purpose, sometimes. The hand-coding group hit more errors and did better on debugging, which Anthropic guesses is why. Build one small feature a week with the AI closed (a suggestion, not something the study tested).
- Use the tutor modes. The write-up cites Claude Code’s Learning and Explanatory modes and ChatGPT’s Study Mode as examples of learning modes designed to foster understanding. It did not test them.
- Predict, then run (not from the study). Before you run code, write down what you expect. When you are wrong, that is the lesson.
Here is a prompt that turns any AI tool into that kind of tutor. Paste it at the start of a chat (in Lovable’s project Instructions (called Knowledge in older docs), in a Cursor rule file under .cursor/rules/ as covered in the Cursor rules post, or just at the top of a new conversation):
Act as a tutor, not a code generator. I'm learning to read and debug code.When I show you code or an error: first ask me what I think it does or whyit fails. Then give me one hint, not the answer. Only show a fix after I havetried twice. After any fix, ask me to explain it back in my own words and tellme what would break if I deleted each changed line.The path: seven stages
These stages are a suggested order the study did not test. Each has a free resource, a proof you do with the AI closed, and a rough time guess (a guess, not a measurement). Start with stage 1 this week, or stage 5 if you only have an hour a week, since tests protect the app you already have.
| Stage | Learn | Free resource | Proof, done without AI | Rough guess |
|---|---|---|---|---|
| 1. Terminal and git | Files, commands, branches (parallel copies of your code), undoing things | The Missing Semester from MIT, the Pro Git book, or our git guide | Make a branch, commit, break something, get back to the last good commit | a weekend |
| 2. How the web works | Requests, responses, cookies, DevTools | MDN: Learn web development | Open DevTools on your app, find the request that loads your data, say what it returns and who could call it | a week of evenings |
| 3. One language, properly | Types, functions, arrays, errors | CS50x from Harvard, or MDN’s JavaScript pages | The exercise below, and reading a stack trace aloud | weeks |
| 4. Databases and SQL | Tables, joins (combining two tables), who can see which rows | SQLBolt and the PostgreSQL tutorial | Write the query for “my invoices only” and explain why row level security exists | a few evenings |
| 5. Tests | Writing a failing test before a fix | Node’s test runner, and TDD with AI | Take a bug, write a test that fails because of it, then fix it. See test behaviors, not code | an evening |
| 6. Reading other people’s code | Following code you did not write | First Contributions | Read one function in a library you use and explain it in writing | ongoing |
| 7. Running something real | Logs (the app’s diary), backups, rollbacks, cost | Your own app, and the launch checklist | Restore a backup into a new database and check the uploaded files came back too (checklist item on backups). Roll back a bad deploy | a weekend |
Do not finish a stage before building. Let the stage catch up with what just hurt:
| What just happened | Go to stage | Read |
|---|---|---|
| The AI keeps “fixing” the same error | 3 | Stop pasting the error back |
| A fix broke a different page | 5 | Your AI fixed one bug and broke two |
| The app gets slower with more users | 4 | Why your app gets slower |
| One user could see another’s data | 2 and 4 | Row level security explained |
| A key or password ended up in the code | 2 | Finding leaked API keys |
| A deploy broke the live app | 7 | Roll back a bad deploy |
| You ran a command and made a mess | 1 | Git for vibe coders |
A short exercise for stage 3
This one is real and runnable. Download the folder as a zip, or browse /examples/hand-debug-exercise/. It has a function that returns the best scores, with four tests and two bugs. You need Node 22 and no other packages.
cd hand-debug-exercisenode --testNo Node? Paste the function below into your browser console (F12) and call topScores([5, 40, 12, 100, 9], 3).
function topScores(scores, n) { scores.sort(); scores.reverse(); return scores.slice(0, n);}The tests fail first:
$ node --test✖ returns the highest scores, best first✖ does not rearrange the list it was given✔ asking for more scores than exist returns what there is✔ an empty list gives an empty listℹ tests 4 ℹ pass 2 ℹ fail 2
expected: 100, 40, 12actual: 9, 5, 40Now close the AI and fix it. Predict first: what does [5, 40, 12, 100, 9].sort() return? Write it down, then run it: [100, 12, 40, 5, 9]. Stuck after 15 minutes? Ask the AI to explain sort without giving the answer.
What you should have found: by default sort() turns numbers into text and compares them as text, so "100" sorts before "12" and "9" after "40" (MDN). And sort() and reverse() change the array you passed in (“in place”), which the second test catches. The fix is a copy and a number comparison: [...scores].sort((a, b) => b - a).slice(0, n). Then all four pass:
ℹ tests 4 ℹ pass 4 ℹ fail 0The tests check what the function returns and that it leaves its input alone, not how it is built. They only protect these four promises, not every input.
Check by hand
Pick one file your AI wrote this week. Without asking it, write one sentence per function: what goes in, what comes out. The first one you cannot write is your next thing to learn.
Reading is half the skill and reviewing is the other half. Here is how to review a pull request from an AI, and what a full review of an AI-built app turns up.
The Get AI Native ebook goes deeper on this. It is free, and the expected launch is around Christmas. Join the waitlist on the homepage.