Hacker News new | ask | show | jobs
by AlexCoventry 295 days ago
Why is reading code harder than writing it?
1 comments

I think it has to do with mental model. If you already know what to write and it is reasonably complex you'll have a mental model ready and can quickly write it down (now even faster as LLMs autocomplete 3-4 lines at a time). While reading someone else code you'll have to constantly map the code in your mind with code written and have to then compare quality, security and other issues.
Yeah, it's exactly this. Having to create a mental model from the code is much harder than having one and just writing it out.
I just tend to find LLM code output extremely to read, I guess. It tends to be verbose and do a lot of unnecessary stuff, but I can always get the point easily and edit accordingly.
I'd say just reading your own code from a few years back will be as hard as reading someone else's.