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

· 8 min read ·

A man in a green sweater climbing a winding wooden staircase of stacked books toward a lit window, while a small white robot follows a step behind holding up a lantern

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 AIPeopleQuiz score (about)What they did
Generation, then comprehension286%Generated code, then asked follow-ups until they understood it
Hybrid code and explanation368%Asked for code and an explanation of it together
Conceptual inquiry765%Asked only conceptual questions, wrote the code themselves
AI delegation439%Had the AI write everything
Progressive reliance435%Asked a question or two, then delegated all code writing
Iterative AI debugging424%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.

  1. 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.
  2. 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).
  3. 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.
  4. 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 why
it fails. Then give me one hint, not the answer. Only show a fix after I have
tried twice. After any fix, ask me to explain it back in my own words and tell
me 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.

StageLearnFree resourceProof, done without AIRough guess
1. Terminal and gitFiles, commands, branches (parallel copies of your code), undoing thingsThe Missing Semester from MIT, the Pro Git book, or our git guideMake a branch, commit, break something, get back to the last good commita weekend
2. How the web worksRequests, responses, cookies, DevToolsMDN: Learn web developmentOpen DevTools on your app, find the request that loads your data, say what it returns and who could call ita week of evenings
3. One language, properlyTypes, functions, arrays, errorsCS50x from Harvard, or MDN’s JavaScript pagesThe exercise below, and reading a stack trace aloudweeks
4. Databases and SQLTables, joins (combining two tables), who can see which rowsSQLBolt and the PostgreSQL tutorialWrite the query for “my invoices only” and explain why row level security existsa few evenings
5. TestsWriting a failing test before a fixNode’s test runner, and TDD with AITake a bug, write a test that fails because of it, then fix it. See test behaviors, not codean evening
6. Reading other people’s codeFollowing code you did not writeFirst ContributionsRead one function in a library you use and explain it in writingongoing
7. Running something realLogs (the app’s diary), backups, rollbacks, costYour own app, and the launch checklistRestore a backup into a new database and check the uploaded files came back too (checklist item on backups). Roll back a bad deploya weekend

Do not finish a stage before building. Let the stage catch up with what just hurt:

What just happenedGo to stageRead
The AI keeps “fixing” the same error3Stop pasting the error back
A fix broke a different page5Your AI fixed one bug and broke two
The app gets slower with more users4Why your app gets slower
One user could see another’s data2 and 4Row level security explained
A key or password ended up in the code2Finding leaked API keys
A deploy broke the live app7Roll back a bad deploy
You ran a command and made a mess1Git 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.

Terminal window
cd hand-debug-exercise
node --test

No 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, 12
actual: 9, 5, 40

Now 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 0

The 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.

Comments