Is Learning to Code With AI Bad? What Experiments Show
- You can learn to code with AI, but if you hand it the code wholesale, you learn less.
- In a preprint experiment, developers who learned a new library with an AI assistant scored 15.4 percentage points lower on a quiz.
- With the same AI, patterns that asked about concepts or for explanations averaged 65 to 86%; leaving code or debugging to AI, 24 to 39%.
- Beginners who practised with AI, in a course where every task was followed by a no-AI edit, did not fall behind a week later.
- Ask about concepts, read your own errors first, and rewrite the code from memory the next day.
You can learn to code with AI, but if you let it write the code for you, you finish the task and learn less. In a preprint experiment, developers who picked up a new Python library with an AI assistant scored 15.4 percentage points lower on a follow-up quiz than developers who learned it without one. Yet some people using the very same AI scored high: the ones who asked about concepts or asked for explanations. Ask about concepts, write the code yourself, and read your own errors first.
Does learning to code with AI make you a worse programmer?
Letting AI write the code makes you learn less. In a randomized experiment the AI group scored lower on a quiz and did not save much time.
Shen and Tamkin (2026), in a preprint not yet peer reviewed, gave 52 developers, all with more than a year of Python, two tasks in an asynchronous library none of them had used (Trio). Half had an AI assistant (GPT-4o) that could write the full solution; half had only the instructions and web search. Afterwards everyone took a 27-point quiz without AI, with questions on concepts, code reading, and debugging.
The AI group scored 4.15 points lower on average. That is 15.4% of the full score, a medium-to-large effect (d = 0.738). Time to finish did not differ significantly. The no-AI group's average was higher at every experience level, from 1 to 3 years to 7 or more (the 1 to 3 year group had only 4 people). In an exploratory breakdown, the widest gap was on the debugging questions.
People who worked without AI ran into a median of 3 errors during the task; people with AI ran into 1 (Shen & Tamkin 2026, Table 4).
The researchers trace the gap to those errors. The no-AI group more often hit errors tied to Trio's core ideas, such as the warning you get when you forget await, and resolved them on their own. Most of the AI group's code ran on the first try. Code that runs at once feels good, but the chance to wrestle with the idea goes with it.
Why do people using the same AI get such different results?
Because they asked the AI to do different things. People who asked about concepts, or who asked for explanations along with the code, scored high.
The researchers watched the recordings of 25 of the 26 people in the AI group and sorted 24 of them into six patterns. Three patterns averaged 65% or more on the quiz; three averaged under 40%.
Patterns that asked about concepts or for explanations averaged 65 to 86%; leaving code or debugging to AI averaged 24 to 39%
See the numbers
| Quiz score | |
|---|---|
| Ask after | 86 |
| Code + why | 68 |
| Ideas only | 65 |
| Paste all | 39 |
| Paste later | 35 |
| AI fixes | 24 |
The three high-scoring patterns were these. Some people took generated code and then asked follow-up questions such as "why does this work?" Some asked for code and an explanation together. And some asked only conceptual questions and wrote the code themselves. The concepts-only group hit many errors but fixed them on their own, and they were the fastest of the high scorers.
The low-scoring patterns all handed the thinking to the AI. Some pasted AI code from the start. Some asked questions on the first task and delegated the whole second one. Some asked the AI to fix every error. That last group asked many questions (5 to 15), took the longest, and averaged the lowest.
| Pattern | Time | Quiz |
|---|---|---|
| Generate, then ask | 24 min | 86% |
| Concepts only | 22 min | 65% |
| Delegate all | 19.5 min | 39% |
| AI debugging | 31 min | 24% |
Source: Shen & Tamkin (2026), Figure 11. Four of the six patterns shown.
One more finding stands out. People who pasted the AI's code and people who retyped it by hand did not differ noticeably on the quiz. The researchers suggest that mental effort may matter more than time spent typing.
Can AI-written code still turn into your own skill?
It can. In a course where every task was followed by modifying the code without AI, complete beginners who practised with AI did not fall behind.
Kazemitabaar and colleagues (2023) taught Python to 69 learners aged 10 to 17 who had never written text-based code, in two groups. One group could use an AI code generator (Codex). In both groups, each of the 45 tasks was followed right away by a task to modify that code without AI. A day later and a week later, everyone took tests without AI.
The AI group led by far in practice and did not trail on the no-AI test a week later
- With AI
- Without AI
See the numbers
| With AI | Without AI | |
|---|---|---|
| Practice writing | 80.1 | 44.4 |
| Week later writing | 59.1 | 49.8 |
| Week later modifying | 47.5 | 34.8 |
The AI group did not always use it well. On 49% of the tasks where they used the generator, they submitted its code unchanged. When the same team analyzed the logs of the 33 learners who had AI, those who more often asked for a whole solution in one prompt tended to score lower on the tests, and those who wrote part of the code themselves tended to score higher, but none of these links was statistically significant.
The two studies differ in who took part and what they did. Still, they point the same way. In both, learning held up better when people kept thinking about the AI's code, with a follow-up question or a no-AI edit. Neither study tested such a step on its own.
Why does coding with AI feel easy, then leave you stuck?
Because code that runs is not the same as code you understand. The faster AI hands you an answer, the easier it is to confuse the two.
Prather and colleagues (2024) watched 21 students in an introductory programming course solve a problem with Copilot and ChatGPT, using eye tracking and interviews. Twenty of the 21 finished. But 10 struggled along the way, and 9 of those reached the answer with AI's help. From what they observed, the researchers judged that most of those who struggled thought they understood more than they did. The researchers called it an illusion of competence.
In Shen and Tamkin's experiment too, the no-AI group reported learning more. One person in the AI group wrote that they "got lazy," and another that there were "still a lot of gaps" in their understanding. The gap between feeling you studied and actually knowing is the subject of the note on improving metacognition.
How to learn to code with AI, starting today
You do not need to give up AI. Change what you ask it to do.
- Ask about concepts, write the code yourself. Ask "what is a nursery?" or "what happens if I leave out
await?", then write the code from the answer. - If you take code, ask why next. "What breaks without this line?" "How is this different from the other way?" The two people who did this had the highest average.
- Read your errors first. Read the message, write one line on what you think the cause is, and try fixing it for about five minutes. If you are still stuck, ask for a hint and include your guess.
- Change the code you got once, without AI. Alter a condition or add one feature. In the beginner study every task had this step, and the AI group did not fall behind (the step itself was not tested separately).
- Rewrite it from memory the next day. Rebuilding yesterday's code in an empty file shows you what you still do not know. How to word your questions is in the note on asking AI questions.
In Aloom
Aloom starts with a question to AI. While learning to code you ask something like "why do I get a warning when I leave out await?", keep only the answers worth keeping, and they connect to what you already know. From the next day the kept answers come back as questions, 1, 3 or 5 a day as you choose, and the more you recall them first, the darker their ink. Aloom's reviews are true-or-false and multiple choice, so practise writing code separately, as in steps 4 and 5 above. Try keeping one concept you asked about today in Aloom.
Frequently asked questions
Is it bad to use AI when learning to code?
No, but pasting its code and moving on teaches less. In the experiments, asking about concepts or asking why about the code went with higher scores, and beginners who changed each program without AI did not fall behind.
Can you learn coding with ChatGPT?
Yes, if you use it as a tutor rather than a code writer. The high-scoring patterns above all came from the same AI as the low-scoring ones. Learning modes that guide you with questions instead of answers (ChatGPT's study mode, Claude's learning mode for education, or the Learning style in Claude Code) are another option, though the studies above did not test them.
Does vibe coding teach you to code?
Probably less, if you hand over all the code. In the experiment above, the four people who delegated everything finished fastest and averaged 39% on the quiz. The researchers expect agentic tools, which write code on their own, to cut learning further than a chat assistant does. That has not yet been tested.
References
- Shen, J. H., & Tamkin, A. (2026). How AI impacts skill formation. arXiv:2601.20245.
- Kazemitabaar, M., Chow, J., Ma, C. K. T., Ericson, B. J., Weintrop, D., & Grossman, T. (2023). Studying the effect of AI code generators on supporting novice learners in introductory programming. CHI '23.
- Kazemitabaar, M., Hou, X., Henley, A., Ericson, B. J., Weintrop, D., & Grossman, T. (2023). How novices use LLM-based code generators to solve CS1 coding tasks in a self-paced learning environment. Koli Calling '23.
- Prather, J., Reeves, B. N., Leinonen, J., MacNeil, S., Randrianasolo, A. S., Becker, B. A., Kimmel, B., Wright, J., & Briggs, B. (2024). The widening gap: The benefits and harms of generative AI for novice programmers. ICER '24.