Press enter or click to view image in full size
10 years ago I wrote Don’t copy-paste code. Type it out. At the time, I hadn't read the "Learn Python the Hard Way" book by Zed Shaw yet. This whole post speaks to the heart of "things that work effectively are discovered, never invented".
The "Learn Python the Hard Way (LPTHW)" book is dated. Sure.. The Python it teaches is old, the tone abrasive. Friendlier tutorials with interactive notebooks and AI explainers have replaced most of its lessons.
However, Zed was right about one thing, and every modern tutorial gets "that" thing wrong: LPTHW makes you type the code by hand, you cannot copy-paste or "click to run", that's frowned upon. You read the example, type it into a file, and run the file yourself.
That sounds like a stylistic choice, but it's not. Intentionally or not, that practice is grounded on the deepest research of the neuro-science on how learning works. It is the only part of the book that still matters, more so now than in 2010.
My original post from 2016 focused on Cargo Cult programming and the learning Return on Investment (ROI). The only thing that changed was the source of the pasted code. In 2016 it came from Stack Overflow. In 2025 it comes from a model that writes fluent Python faster than you can read it. The learning cost of pasting (or rather letting the tool do it for you) is the same.
LPTHW had a three-step pattern in every exercise: type the code exactly, run it, then break it on purpose and fix it. Modern tutorials keep the first two steps and drop the third. AI tutors dropped the first one too. What remains after that is a reading exercise posing as a "writing" exercise.
Reading code teaches you what a working program looks like. Typing it teaches you what a broken one looks like while YOU gain the experience of breaking it.
You spend your career staring at code that does not run. Figuring out why is the job. Watch a beginner type dfe instead of def without computing assistance (LLM, syntax highlighting, etc.). Python throws a SyntaxError. The traceback points to a line. The beginner reads the line and sees dfe my_function(): staring back at them.
The word looks almost right. It takes them thirty seconds to spot the swapped letters. They fix it and run the file again. Thirty seconds of confusion is the lesson. The typo that triggered it is forgettable. In those thirty seconds, the beginner learned four things. Python has keywords the parser cares about. SyntaxError points at the line, not the character.
The word def has a shape, and that shape now lives in their fingers. Their own typing is the first place to look on a file that refuses to run. There is a physical layer to this that copy-paste skips. Your fingers learn the shape of def and return and import through repetition.
Learning from typing works like muscle memory to memorize a phone number.
The motion gets cheaper. The pattern becomes recognizable from the inside, not just from the page. Compare that to pasting a working snippet from an LLM. The snippet runs and you move on. The failure mode hiding in that snippet stays invisible to you.
Get Fayner Brack’s stories in your inbox
Join Medium for free to get updates from this writer.
Senior engineers know this on instinct. Try to watch one of them learning a new library or programming language. They do not paste the quickstart example into a file. They retype it. Often badly. They mistype an import. Python throws a ModuleNotFoundError. They fix the typo and try again.
Fail, Succeed. Fail, Succeed. Fail, Succeed…
A wrong method name gives them an AttributeError. Four or five rounds of this, and the example runs. They know what each error looks like in this particular package.
A junior who pasted the same example has a working program and no map.
For an engineer who already has the mental map for a language, pasted code is the right tool. You are not learning Python the third time you write a list comprehension. You are getting work done.
If you have the mental map and expertise after deliberate training, the failure modes are familiar. Speed is the constraint that matters.
Let me repeat that again: IF-YOU-HAVE-THE-MENTAL-MAP-AND-EXPERTISE-AFTER-DELIBERATE-TRAINING.
The problem is for the learner who does not yet have a map. Their tutorials and computing assistance treat pasting and writing as the same skill, promoting the dumbification of humanity.
Autocomplete (LLM or otherwise) for learning produces a specific kind of shallow fluency. You can recognize correct code by sight. You can describe what it does at a high level. You cannot reconstruct it from a blank file. A library update shifts a method signature by one argument. The pasted code breaks, and you have no idea which line to suspect so you rely on the machine. Again. That is, unless you explicitly ask to not solve the problem at all but to explain the issue so YOU can fix yourself.
A learner who typed the code by hand has that instinct. A learner who pasted it knows only that the code used to work.Either the shape of the code is in your fingers, your muscle memory, or it's not.
Reading Python code teaches you what works. Writing it badly teaches you what breaks.
And THAT is what makes you learn.
I've made a summary of the book here. If you're interested in more details, I strongly recommend reading and practicing it!
If you liked this, you might like readplace.com, built for exactly this kind of reading.
Thanks for reading. If you have some feedback, reach out to me on LinkedIn, Github, Reddit, or by replying to this post.