Type out the code

https://lobste.rs/rss Hits: 49
Summary

Back in the day I read one of Zed Shaw's "Learn X the hard way" courses (I think it was his C++ course) and he began the course with a disclaimer that said something like "do not copy and paste the examples; type them out" because he believed strongly that doing so improved your comprehension of the material. These days he recommends something even stronger: The best way to do this is when you complete an exercise delete what you did and do it again, but try to use your memory. If you get stuck then look at the exercise for clues, but try your best to recreate what you just did from memory. At first you'll be constantly referring to the exercise and the code, but eventually you'll get to where you can do it on your own. This will also improve your ability to remember more code, your ability to summarize how something works, and generally improve your skills faster than if you did it once and moved on. This is known as the generation effect in cognitive psychology: the active generation of new content improves comprehension compared to passive consumption of the same material. Or as Richard Feynman put it: "What I cannot create, I do not understand". I'm not a researcher, but I would still like to add my own spin as a lay programmer on why I believe this phenomenon matters for improving programming ability, even in the age of agentic coding. In fact, I think it's even more important now than ever for people to reacquaint themselves with this "ancient wisdom" because otherwise we'll end up with an entire generation of programmers wondering how anyone ever programmed without the help of a coding agent. In this post I will lay out the case for why you should occasionally type out the code, character-by-character, as best as possible from memory. That doesn't mean that you should never use developer tools of any sort to streamline the coding process, but you also should occasionally stretch your ability to code without those affordances, too. Freecoding I believe in the ...

First seen: 2026-05-19 15:24

Last seen: 2026-05-21 17:03