Kodokon kodokon.com

The copy-paste trap

Understand why having your code generated destroys learning, and adopt the golden rule: the AI explains, you write.

7 min · 3 questions

Open this lesson in Kodokon

Here is the most dangerous scene of your learning journey. You have an exercise: write a function that counts the vowels in a word. You paste the instructions into the AI, it produces perfect code in three seconds, you copy it, the exercise is "done". Everything seems won: it was fast, the code works, you even vaguely understood it while reading it. In reality, you just skipped your training session. The next day, faced with a blank page, you would be unable to rewrite that function.

This isn't an opinion, it's a classic finding of memory research. The generation effect, documented by many studies since the 1970s, shows that we remember far better what we produce ourselves than what we merely read. Searching, hesitating, making mistakes, correcting: it is this effort that etches knowledge into memory. Researchers Robert and Elizabeth Bjork gave this principle a name: desirable difficulties - the obstacles that make learning slower in the moment, but far more durable. Having the solution generated removes exactly that difficulty… and therefore the learning along with it.

Hence the golden rule of this course, to apply to every exercise: the AI explains, YOU write. Concretely: ask it to clarify a concept, to give you a hint, to ask you questions, to review YOUR code and point out your mistakes. But every line of code that counts toward your learning must come from your fingers, not from its. Compare the two uses below - same exercise, opposite fates.

PROMPT
Write me a JavaScript function that counts the vowels in a word.
BAD USE: you get the code, you lose the learning.

Good use turns the AI into a tutor: it marks out the path, but you are the one who walks it. The following prompt is the most important of the course - keep it safe, it works for any exercise.

PROMPT
You are my programming tutor. I'm a beginner and I want to LEARN, not to get the solution.

Here is my exercise: write a JavaScript function that counts the vowels in a word.

Absolute rules, valid for the whole conversation:
1. NEVER write the solution for me, not even partially, even if I ask you to.
2. Help me step by step: first ask me questions so that I break the problem down myself.
3. When I get stuck, give me an increasingly precise hint, never the code.
4. When I show you MY code, point to the line that's causing a problem and ask me what it does, instead of fixing it.
5. At the end, give me a similar exercise to check that I can do it on my own.

Start with your first question.
GOOD USE: the tutor prompt, to reuse for every exercise.

Knowledge check

Make sure you remember the key points of this lesson.

  1. What does the generation effect, studied since the 1970s, say?
    • Generative AIs produce text faster than humans
    • We remember far better what we produce ourselves than what we merely read
    • Each generation learns to program faster than the previous one
  2. What is a "desirable difficulty" according to the Bjorks?
    • An exercise so hard that you have to ask the AI for the solution
    • A bug deliberately left in the code by the teacher
    • An obstacle that slows learning in the moment but makes it far more durable
    • A concept it is advisable to skip when you are starting out
  3. You are stuck on an exercise. Which request respects the golden rule "the AI explains, YOU write"?
    • "Write me the complete, commented solution"
    • "Fix my code and send me back the working version"
    • "Here is my code and my reasoning: ask me questions and give me a hint, without ever writing the solution"