JetBrains Academy
The place for learning and teaching computer science your way
Should You Use AI to Learn to Code?
I’ll start by acknowledging that you probably already do.
And honestly? We get it. Programming is hard! Learning materials can be poorly structured and lack good visualizations. Sometimes your teacher is a math genius who is bad at talking. And hey, AI is pretty capable for beginner-level problems. It can make the implementation much faster for some learners, but for others it can actually make everything worse.
This post isn’t meant to wag fingers or shame anyone. We just want learners to be smart about the way they use new technology – especially one as impactful on the learning process as LLMs. Indeed, sometimes getting the best learning experience may mean not using AI, but sometimes it just means using it slightly differently.
This is part three in our series How to Learn to Code in an AI World. Don’t miss the first, Is it Still Worth Learning to Code?, and second, Learning to Think in an AI World: 5 Lessons for Novice Programmers.

Let’s get right to it: Should you use AI when learning to program?
Our answer is best expressed as a graph:

In short, the more of a beginner you are, the less you should use AI to generate code for you.
There are a lot of reasons for this, namely:
- Skipping the basics makes understanding harder concepts more difficult.
- You accept more bad suggestions because your code reading skills are not developed.
- It speeds you up, which is good for productivity but bad for knowledge retention.
- You feel less ownership over your work, which decreases motivation.
- The experience of programming becomes “flatter” – a solution given to you is less satisfying than one you worked for.
- It messes with your perception of how much you know in the following ways:
- You lose self-confidence and feel like you can’t code without AI assistance
- You develop delusionally high self-confidence, where you feel like you’re a great programmer, even though AI is doing most of the work, and you barely understand how a for loop works.
This doesn’t mean you can’t use AI to help you follow your curiosity and increase your motivation to learn things yourself. You can ask it to generate metaphors for challenging abstract concepts, ask questions if no human teacher is available, clarify terms that confuse you, and even get advice on a personal project that is slightly out of your depth.

Still, we would generally advise caution when interacting with LLMs that aren’t specifically tailored for education. Research shows people are very bad at realizing when AI is replacing their thinking rather than augmenting it.
Choosing between no AI, an AI made for learning, or going all in is difficult. In the next part, we’ll go a bit deeper into the pros and cons of each of these options.
Non-AI materials and tutors
Inconvenient, but better for knowledge retention and accuracy
Non-AI materials require us to commit to the active process of digging through books, documentation, and forums to find answers. It can take much longer compared to prompting an LLM, but the benefit is that it fully engages us in our own learning (as long as it doesn’t ruin our motivation by being too boring). Our brains interpret the additional time as a sign of importance, which in turn enhances our memory of what we learned. Moreover, we might stumble upon unexpected gems in a way that’s difficult with AI-generated answers.
Let’s also not overlook the human element here: a skilled teacher can offer a personal perspective that significantly outweighs the convenience of AI. Through good teachers we learn to love a subject and believe in ourselves, profoundly impacting the experience of learning and our long-term motivation.

AI tutors
Extremely convenient but hard to get right in practice
Usually, when we interact with AI, we’re looking for a quick and easy answer. Even when it’s engineered to prompt us to do some thinking on our own, we tend to unconsciously skip over those questions and shortcut to the solution. It requires a lot of willpower to slow down and truly digest the information AI gives us, not to mention reflect and relate it to previous things we’ve learned, and finally, understand how to apply it in practice.
If you’re good at making yourself slow down and think, then tutor away! But, if you find yourself spending most of your time prompting, skimming, and rushing toward output – skipping the high-level thinking parts of coding – then we’d recommend you take a break from AI and find ways to allow for more thoughtful reflection into your practice.

AI assistants
Great for doing things, less great for learning things; to use them wisely requires a strong foundation
There are as many opinions on the best way to use an AI assistant as there are software developers. Some use it every time they code and some prefer a whiteboard and a rubber duck. Over time you’ll learn your preference and style. The important thing is for you to figure out how to write quality code quickly and in a way that feels good.
If you do use it, we definitely recommend spending some focused time learning best practices – like any technology, it takes some intention to learn to use it well. See our course catalog for free courses like Coding with AI assistant or Prompting to debug and fix AI-generated code.

In summary, while AI tools are incredibly convenient, it’s crucial for beginners to exercise caution. Overreliance on AI for code generation can hinder foundational understanding, knowledge retention, and intrinsic motivation.
The best approach involves balancing AI assistance with traditional learning methods, fostering computational thinking, and staying smart about when you use it. Ultimately, the effectiveness of AI in your coding journey depends on your learning style, current skill level, and how thoughtfully you integrate these powerful tools.
This is the third post in our series How to Learn to Program in an AI World. Keep an eye out for the last installment, which will land on our blog in the coming months. If you missed it, check out part 1, Is It Still Worth Learning to Code? and part two, Learning to Think in an AI World: 5 Lessons for Novice Programmers.