3 ms·
> It’s easy to understand code as you are writing it. You are executing it and refining it as you go. But it’s hard to understand code just by reading it after
by civilized 3y ago
> It’s easy to understand code as you are writing it. You are executing it and refining it as you go. But it’s hard to understand code just by reading it after the fact.
After it's written, you can execute it and refine your mental model of it as you go, and you're relieved of the burden of having to write the code. So in theory it could be easier. The problem is programmers have an unreasonable expectation that they should be able to understand legacy code just by reading it. When it should be treated as a science project to understand a mysterious ancient artifact. Don't just stare at it and chin-scratch, probe it actively.
Oh, and the stuff they didn't document? They didn't understand it at the time, either.