Sub topic 1
Why Working Code Is Not the Same as Learning
AI assistants can produce working code in seconds. That speed makes it easy to finish a task without learning anything from it. This chapter explains the gap between a finished program and a skill you own, and it sets up the rest of the tutorial.
Prerequisites
This chapter assumes you have:
- Basic programming in at least one language: variables, functions, conditionals and loops.
- The ability to run a script and a simple test in a terminal or editor.
- Some experience with a chat-based AI assistant or code completion tool.
Output versus skill
A working program is an output. Programming skill is the ability to produce that output yourself, to understand why it works, and to fix it when it breaks. Output can be copied. Skill has to be built through your own practice.
Before AI assistants, the two usually arrived together. If you wanted a working function, you had to struggle with it, and the struggle taught you. Now you can get the output without the struggle. The task is done, the tests pass, and you may still be unable to write the same code tomorrow.
The illusion of competence
Reading a correct solution feels like understanding it. Each line looks reasonable, and you nod along. This feeling is called the illusion of competence. Recognizing an answer is much easier than producing one from a blank editor.
You can test yourself with a predict-then-run exercise. Read this function and write down what you expect it to print before you run it.
def count_vowels(text):
return sum(1 for ch in text.lower() if ch in "aeiou")
# Predict the output before you run this line.
print(count_vowels("Learning with AI"))The expected answer is 6. If your prediction differed, find out why. Perhaps you missed that lower() makes the capital "A" and "I" count. That gap between prediction and result is where learning happens. If you had only pasted the code and seen it run, you would never have noticed the gap.
Two paths to the same result
The diagram compares two ways of completing the same task.
Both paths end with code that runs. Only the second leaves you able to do the next task without help.
What gets skipped
When you hand the whole problem to an AI, you skip several activities that build skill:
- Breaking the problem down. You never decide what the steps are.
- Making and fixing mistakes. Errors point you to gaps in your mental model, and you never meet them.
- Retrieval. You do not pull knowledge from memory, so it does not strengthen.
- Choosing between options. You never compare designs, so you cannot judge them later.
Later chapters cover each of these in detail. For now, the point is that the skipped work was the learning.
Where AI helps and where it hurts
AI is not the problem. The same tool can support learning or replace it, depending on how you use it.
| Use of AI | Effect on learning |
|---|---|
| Ask for a hint after your own attempt | Supports it. You still do the reasoning. |
| Ask it to explain code you wrote | Supports it. You get feedback on your own work. |
| Ask for a full solution before trying | Undermines it. You skip the struggle. |
| Paste code you cannot explain | Undermines it. You gain output but not understanding. |
A useful test is to ask whether you could rebuild the solution without the AI tomorrow. If not, you borrowed the result and did not learn it.
The goal of this tutorial
The rest of this tutorial gives you workflows that keep the AI useful and keep you in charge of the thinking. You will learn to attempt problems first, ask for hints instead of answers, check AI code with your own tests, and measure your progress with checks that use no AI at all.
Exercise
You ask an AI for a function, paste it, and all your tests pass. Give two questions you could ask yourself to find out whether you learned anything.
Show answer
Examples: Can I explain each line without looking at the AI's text? Could I write a similar function from scratch tomorrow with no help? Can I predict what it returns for a new input before I run it? If the answer to any of these is no, you have working code but not yet the skill.