Why ChatGPT Makes You Worse at Coding (and What to Do Instead)
DEV Community

Why ChatGPT Makes You Worse at Coding (and What to Do Instead)

Why ChatGPT Makes You Worse at Coding (and What to Do Instead)

ChatGPT can write better code than most junior developers. It can explain concepts, debug errors, and generate entire functions in seconds. For experienced developers, it is a superpower. For beginners trying to learn how to code, it is a trap.

The Problem: Copying Code You Do Not Understand

When a beginner asks ChatGPT "write me a function to sort a list in Python," they get perfect code instantly. They paste it into their project, it works, and they move on. They did not learn anything. They learned how to prompt ChatGPT, not how to code. The dangerous part is that it feels like learning. You built something. But the knowledge never transferred from the screen into your head. It is like watching someone else lift weights for you and claiming you got stronger.

I have watched students submit code they generated with ChatGPT without understanding a single line of it. Ask "why did you use a for loop here instead of a list comprehension?" and the honest answer is usually: "I don't know, ChatGPT wrote it."

Why This Happens: The Missing Step is Prediction

Traditional learning goes: read code, run code, see output, "okay, got it." The step almost every tutorial skips is predicting what will happen before you run it.

numbers = [1, 2, 3]
numbers.append(4)
print(numbers)

Most tutorials just tell you: this adds 4 to the list. Move on. A better version stops and asks: before running this, predict what numbers will be after line 2. Write it down. Now run it. Were you right? If you predicted [1, 2, 3, 4], you understood the concept. If you predicted [1, 2, 3] or [4], you just found a real gap in your mental model, and that gap is exactly where learning happens.

The Fix: Predict, Write, Compare

Active prediction creates understanding that passive watching never can. The loop is simple:

  1. Predict: read the problem and predict what the code should do, before you write anything.
  2. Write: now write your own solution.
  3. Compare: run the expected solution, compare it to yours, and explain the difference out loud or in writing.

Take a problem like "filter a list to only include numbers greater than 5." Predict: before writing anything, decide, should this use a for loop, a list comprehension, or a filter function? What should the output look like? Write: now write your solution. Compare: look at your solution next to a reference one. If you reached for a for loop and the reference used a list comprehension, do not just shrug, explain why the comprehension is cleaner or more idiomatic. That explanation is where the concept actually sticks.

How to Use ChatGPT the Right Way

ChatGPT is not the enemy here. Using it passively is. Good uses, where you are the one doing the thinking:

  • "Explain why this code uses enumerate instead of range"
  • "What is the difference between .append() and .extend()?"
  • "I wrote this function but it is slow, how would you optimize it, and why?"

Bad uses, where ChatGPT does the thinking for you:

  • "Write me a function that does X" (then copy-paste without reading it)
  • "Here is my homework, solve it"
  • "Generate a complete program for X"

The rule that keeps you on the right side of that line: use ChatGPT to explain code, not to generate it for you.

Try This for 7 Days

Here is something concrete to try starting today. For the next seven days, every time you are about to run a piece of code:

  1. Stop.
  2. Write down your prediction, on paper, in a comment, anywhere.
  3. Run the code.
  4. If your prediction was wrong, write one sentence explaining why.

By day seven, you will notice your predictions getting more accurate, you will start catching bugs before you even run the code, and you will stop needing to run code just to find out what it does. That is the actual difference between copying and understanding.

Choose Understanding

Learning to code is hard. ChatGPT can make it easier, or it can make it impossible. The difference is whether you are using it to understand code, or using it to avoid understanding code. Choose understanding.

If you want a structured way to practice this, I built Arclab around this exact loop. Every lesson forces you to predict before showing you the answer. It is free to try. This post originally appeared on the Arclab blog.

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.