Prevent cognitive debt by manually retyping LLM-generated code

179 points · 136 comments on HN · read original →

Points and comments are a snapshot, not live.

Manually retyping LLM-generated code preserves understanding and prevents cognitive debt.

The author, despite earlier skepticism, still uses coding assistants on personal projects but found that letting them roam free created cognitive debt. Their solution: instruct the LLM to show proposed edits in chat rather than modifying files directly, so the author manually types every change. This slows them from 10x to about 2x faster than without LLMs, but forces deep comprehension, lets them catch hallucinations and bad design, and builds a spatial mental map of the codebase. The practice mirrors old advice to never copy-paste code from books or forums, prioritizing understanding over raw productivity. The author warns the industry is accumulating cognitive debt it will soon have to repay.

What commenters are saying

Commenters split into two camps: those who see the retyping practice as a useful antidote to losing context from agentic coding, and those who argue it is too slow and choreful for personal projects. Proponents counter that typing speed is rarely the bottleneck and that slowing down prevents the spaghetti-code problems that emerge after a month of unsupervised LLM use. A few commenters recommend simply asking the LLM questions without letting it write code, or using a cheaper plan for that purpose. One thread debates whether LLMs produce genuinely better code than most humans, with some arguing that measurable engineering criteria-executable specs, performance tests, API docs-make code quality objectively assessable regardless of domain expertise.