You can learn programming with AI faster than with a book alone. You can also finish a month of AI-assisted “learning” and find you can’t write a loop without it. The difference isn’t which chatbot you pick. It’s how you use it. This guide is for people picking up a new programming language, whether it’s your first or your fourth, and it’s built on official docs, one controlled study, and a small test we ran in Python and JavaScript.
Quick answer: To learn programming with AI, follow the language’s official tutorial and use AI as a tutor beside it: turn on a learning mode, ask for explanations instead of solutions, write the code yourself, then ask the AI to review it. If you already know a language, ask it for the “false friends” that behave differently in the new one.
- In Anthropic’s January 2026 study, people learning a new Python library with AI help scored 50% on a quiz afterwards, against 67% for those who coded by hand.
- Learners who asked only conceptual questions were among the highest scorers.
- ChatGPT has a Study mode, and Claude Code has a Learning output style that leaves small pieces of code for you to write.
- In our test, 6 of 8 everyday expressions gave different results in Python and JavaScript.
Can you learn programming with AI?
Yes, but there’s a trap, and it now has data behind it.
In January 2026 Anthropic published a randomized study, How AI assistance impacts the formation of coding skills. 52 mostly junior engineers learned Trio, a Python library none of them knew. Half had an AI assistant. On a quiz afterwards, the AI group averaged 50% and the hand-coding group 67%. The AI group finished about two minutes faster, a gap that wasn’t statistically significant. The biggest difference showed up on debugging questions.
The interesting part is who did well inside the AI group. People who handed everything to the assistant, or slid into that halfway through, averaged under 40%. People who asked only conceptual questions and fixed their own errors scored 65% or more, and they were the fastest of the high scorers. The authors are careful to say those small groups don’t prove cause. Still, the pattern matches what teachers have said for years: the struggle is where the learning happens.
So the goal isn’t to avoid AI. It’s to use it in the way that kept people learning.
Step 1: Start from the official tutorial
Every serious language has a free official tutorial written by people who know where beginners trip. Python has the Python Tutorial. JavaScript has MDN’s JavaScript Guide. Go has A Tour of Go, and Rust has “The Book”. These give you an order of topics that actually builds. A chatbot doesn’t, unless you ask for one, and even then it’s guessing at your gaps.
Use the tutorial as the spine. Open the AI in a second window and use it only when a section confuses you. That one habit keeps you in charge of what you learn next.
GitHub’s own post on using AI coding tools to learn a new language says the same thing in its own words: AI tools are assistants, not replacements, and you still need tutorials, books or courses next to them.
Step 2: Turn on a learning mode
Default chat modes are built to give you the answer. That’s what you want at work. It’s the wrong thing when you’re learning, and two of the big tools now ship a fix.
ChatGPT Study mode
OpenAI’s help article on using study mode in ChatGPT says it’s available on every ChatGPT plan, on web, iOS and Android. You pick Study from the suggestions in a chat, or go to chatgpt.com/studymode. Instead of a full answer, it walks you through the problem with questions. OpenAI’s own note is worth repeating: it can still make mistakes, so check anything important.
Claude Code’s Learning output style
If you’re learning inside a real project, Claude Code has a built-in Learning style. Per the output styles docs, Claude does routine parts itself, but when it reaches a real design decision (error handling, a data structure, business logic) it leaves a TODO(human) comment in the file, tells you what to write, and waits. You write it, it gives one short Insight on your code, then carries on. Switch with /output-style learning or through /config.
It’s the closest thing to a pair programmer who makes you drive. We’d use it for week two onward, once the basics from the tutorial are in place. Not sure which agent fits you? Our Claude Code vs Codex vs GitHub Copilot comparison covers the differences.
Step 3: Ask for the false friends
If you already know one language, your biggest risk in the new one isn’t syntax. Syntax errors are loud. The risk is code that looks identical, runs fine, and does something different. Language teachers call these false friends.
We wanted to see how common they are, so we wrote eight everyday expressions in Python 3.12.4 and the closest-looking version in JavaScript, then ran both in Python and Node 24.22.1. The scripts and raw output are saved with this post.

| Expression | Python 3.12 | JavaScript (Node 24) |
|---|---|---|
| 7 / 2 | 3.5 | 3.5 |
| -7 % 3 | 2 | -1 |
| round(2.5) / Math.round(2.5) | 2 | 3 |
| sort [10, 9, 1] | [1, 9, 10] | [1, 10, 9] |
| ‘5’ + 3 | TypeError | “53” |
| [1, 2] equals [1, 2] | True | false |
| empty list is truthy? | False | true |
| 0.1 + 0.2 | 0.30000000000000004 | 0.30000000000000004 |
Six of eight differ. Only one of those six throws an error (the Python TypeError). The rest just quietly give a different answer. JavaScript’s default sort compares items as strings, so 10 lands before 9, which MDN’s sort reference spells out. Python’s round() rounds halves to the even number, as the Python docs note.
This is exactly where AI is a great tutor. Ask it something like:
I know Python well and I'm learning JavaScript.
List 10 things that look the same in both languages but behave
differently. For each one, give a tiny example I can run in Node,
and don't show me the output. I'll predict it first.
The last line matters. Predicting the output before you run it turns a list you’d skim into a quiz you have to think about. Then run every example yourself, because the model can be wrong about edge cases too. Our regex cheat sheet tested in Python and JS is a good second round: regex is full of the same kind of quiet differences.
Here are the fixes we ran in Node for the habits that broke:

Step 4: Write it first, then ask for review
Flip the usual order. You write the function, run it, and only then paste it in with a prompt like “Review this as a senior Go developer would. Point out anything that isn’t idiomatic Go, but don’t rewrite it. Ask me questions instead.” You’ll learn the language’s style from the review, and you keep the part of the work that builds skill.
When you do let AI write code, treat it like code from a stranger. Our checklist on how to review AI-generated code walks through what to check, from fake packages to tests that test nothing.
And when you hit an error? Read it first. Try one fix on your own. Ask the AI what the error means, not how to fix it. In Anthropic’s study, the debugging questions were where the AI group fell furthest behind.
The part most guides skip: asking AI to “translate my Python into JavaScript” feels like a shortcut to learning, and it can teach you the wrong thing. A line-by-line translation keeps the shape of your old code, and the false friends above don’t announce themselves. Your sort runs. Your modulo runs. They just return different numbers. Ask for idiomatic code in the new language and an explanation of every difference from your original, then check the differences by running them.
A 4-week plan to learn a new language with AI
This assumes about an hour a day and that you already know one language. A first-ever language takes longer, and that’s normal.
| Week | You do | AI does |
|---|---|---|
| 1 | Official tutorial, basics. Type every example by hand. | Study mode explanations when stuck. False-friends quiz. |
| 2 | Small exercises from the tutorial, written alone. | Reviews your code for idiom. Asks you questions. |
| 3 | One small project, like a CLI tool or a tiny API. | Learning style in Claude Code: leaves TODO(human) pieces. |
| 4 | Rebuild the project from memory, no AI open. | Only after: compares your rebuild with the first version. |
Week 4 is the honest test. If you can’t rebuild a small project without help, you’ve learned how to prompt in that language, not the language. For prompt templates to keep the review going after week 4, see our AI prompts for learning, which are built around recall and spaced practice.
Common mistakes
- Starting a project on day one with an agent. You get working code and no idea why it works.
- Copying fixes for errors. The error message was the lesson.
- Never running the AI’s examples. Models get edge cases wrong. Your interpreter doesn’t.
- Learning from translated code. See the box above.
- Skipping the docs. The official reference is the thing you’ll use for the rest of your career. Get used to reading it now.
Our verdict
Learning programming with AI works well when the AI asks more questions than it answers. Use the official tutorial as your path, Study mode or Claude Code’s Learning style as your tutor, and your own hands for the code. Ask for false friends early if you know another language. Then prove it by rebuilding something with the AI closed.
Skip all of this if you just need a script working by Friday. That’s a different job, and delegating is fine there. Just don’t expect to have learned the language from it.
FAQ
Is learning programming with AI good?
It depends on how you use it. In Anthropic’s 2026 study, people who delegated code writing to AI learned less, while those who asked conceptual questions and fixed their own errors scored about as well as people coding by hand.
Should I still learn programming now that AI writes code?
Yes, if you want to build or maintain software. You need to read, test and debug what AI produces, and the study above found debugging was the skill that suffered most when people leaned on AI.
How long does it take to learn a programming language with AI?
There’s no official number, and anyone quoting one is guessing. Our rough guess: if you already know a language, four weeks of daily practice should get you writing small programs in a new one. A first language takes months of regular practice.
Can I learn programming with AI for free?
Yes. Official tutorials like the Python Tutorial and MDN are free, and OpenAI says Study mode works on every ChatGPT plan, including Free. Claude Code needs a paid Claude plan or API usage.