DevPlainly
Getting Started

Learning to Code With AI: Don't Avoid It, Learn to Use It

Avoiding AI out of fear is one of the biggest beginner mistakes today. What the research says, and the skills you need to learn faster with AI, not lazier.

· 6 min read

Contents
  1. Why avoiding AI is a mistake
  2. What the research says
  3. The skills you need to use AI well
  4. 1. Prompting
  5. 2. Basic AI thinking
  6. 3. Describing what you want
  7. 4. Choosing the right model for each task
  8. How to use AI as a tutor, not a crutch
  9. FAQ
  10. Is using AI to learn programming cheating?
  11. Will AI stop me from learning to code?
  12. Which AI is best for learning to code?
  13. Do I need to pay for AI to learn programming?
  14. Further reading

Many people who start programming today avoid AI on purpose. Some are afraid it's cheating, some think it will stop them from really learning, and some just don't trust it. I understand the feeling, but I think it's one of the biggest mistakes you can make as a beginner right now.

AI used well is the most powerful learning and productivity tool we have. The key words are used well: it's not as simple as typing a question and copying the answer. This guide covers why avoiding AI hurts you, what the research says, and the basic skills that make the difference.

Why avoiding AI is a mistake

  • The industry already uses it. AI assistants are part of most developers' daily workflow, and job interviews increasingly assume you know how to work with them.
  • You lose a patient tutor. An assistant can explain the same concept five different ways at 2 a.m. without getting tired of your questions.
  • Using it well is a skill. Like using a debugger or Git, getting good results takes practice. The later you start, the further behind you are.

The fear that AI will stop you from learning is reasonable, but the answer is to use it as a tutor, not to avoid it.

What the research says

A randomized controlled trial at Harvard, published in Scientific Reports in 2025, compared two ways of learning the same introductory physics topics (Kestin et al., 2025):

  • An AI tutor students used on their own at home, built on GPT-4 and carefully instructed to follow good teaching practices: guide step by step, don't just give away the answer, and adapt to the student.
  • An in-class lesson with an instructor using active learning, a teaching style that is already considered better than a traditional lecture.

Each of the 194 students experienced both formats on different topics. Students learned significantly more, in less time, with the AI tutor, and they reported feeling more engaged and motivated.

Two important details:

  1. The AI was designed to teach, not just to answer. A general chatbot that hands you finished code won't automatically give you the same result. How you use it matters.
  2. The study was small (one course, two topics, short-term tests). The authors suggest using AI tutors to prepare students before class, so class time can focus on harder skills — as a complement, not a replacement.

The takeaway for beginners: AI can make you learn faster, but only if you make it behave like a tutor.

The skills you need to use AI well

1. Prompting

Vague questions get generic answers. Give the model context (what you're building, your language and version, what you already tried), constraints and the exact error message. Our guide on writing better prompts for AI coding assistants covers a full framework.

2. Basic AI thinking

You don't need to understand neural networks, but you should know a few things:

  • A model predicts likely text. It can sound confident and still be wrong, so you verify what it tells you.
  • It only knows what's in its training data and in your conversation. If it can't see your code, it's guessing.
  • Context has a size limit, measured in tokens. Very long conversations lose details. See what tokens are and why they matter.

3. Describing what you want

Being able to describe a project clearly — what it does, for whom, its main features and its constraints — is the most underrated skill. It's also exactly what you need in a real job when writing a ticket or a README.

4. Choosing the right model for each task

Not every model is good at everything. In general:

TaskWhat to use
Writing and debugging code in a projectA coding assistant that can read your files (in your IDE or terminal)
Understanding a concept or studying for an examA capable chat model, asked to explain step by step
Quick everyday questionsWhatever fast model is easiest to reach, often a free plan
Private code or offline workA local LLM on your own PC

How to use AI as a tutor, not a crutch

The difference between learning with AI and just getting homework done is how you ask:

❌ Write a Java program that reads a file and counts the words.
✅ I'm learning Java. I need to read a text file and count its words.
   Don't give me the full solution. Explain which classes I should look at,
   then let me write the code and review it for me.

A few habits that keep you learning:

  • Ask for explanations, not just code. "Why does this work?" and "What would break if I changed this line?"
  • Try first, then ask. Spend 15–20 minutes on a problem before asking, and show the AI what you tried.
  • Ask it to quiz you. "Give me three exercises on loops, one at a time, and correct my answers."
  • Never submit code you can't explain. If you couldn't rewrite it from memory or justify each line to your teacher, you haven't learned it yet.
  • Follow your school's rules. Many courses allow AI for studying but not for graded work. Ask if you're unsure.

FAQ

Is using AI to learn programming cheating?

Using it to understand concepts, get explanations and review your own code is studying. Submitting AI-written code as your own work when your course doesn't allow it is cheating. Check your course's rules.

Will AI stop me from learning to code?

It can, if you only copy answers. Used as a tutor — asking for explanations, trying first and having it review your work — research suggests it can help you learn faster.

Which AI is best for learning to code?

There isn't one best option. Use a coding assistant for writing and debugging real projects, and a chat model for explanations and practice. What matters more is how well you prompt it.

Do I need to pay for AI to learn programming?

No. Free plans are enough to start, and you can run open models locally. Paid plans mostly give you higher limits and stronger models.

Further reading

Keep reading