Prevent cognitive debt by manually retyping LLM-generated code(ankursethi.com)
503 points by mpweiher 1 day ago | 415 comments
tl;dr: To avoid the cognitive debt of AI-generated code while still benefiting from LLMs, the author instructs their coding assistant to only propose changes in chat, then manually retypes every line into their project. This makes them roughly 2x faster instead of 10x, but forces comprehension, catches hallucinations, and builds a mental map of the codebase—mirroring the old advice to type out example code rather than copy-paste it.
HN Discussion:
  • Retyping is pointless overhead; either code yourself or fully use the LLM
  • Manual typing/engagement with code is timeless good practice for comprehension
  • Mindless retyping reduces developers to code monkeys and won't prevent cognitive debt anyway
  • LLMs amplify capabilities and worrying about losing skills is overblown
  • ~Tried this approach but abandoned it as impractical over time