3 ms·
"If I'm trying to wade through some 10-year old spaghetti code, it would be much easier for me to re-write it." It would be easier to re-write it if you had an
by greenyoda 11y ago
"If I'm trying to wade through some 10-year old spaghetti code, it would be much easier for me to re-write it."
It would be easier to re-write it if you had an exact spec of what it needed to do. But if you had to reverse-engineer the spec from the code itself (which is, in my experience, far more common when working with old code), re-writing it would be harder than reading it, since getting the spec would involve reading the code first anyway.
"It's that most programmers don't write code with the intention of having it read by other programmers."
I think that's a very important point. Nobody would ever try to read a novel written by someone who didn't care about the reader's experience, but we rarely see novels that bad because nobody would pay for one. However, code that's written without the reader in mind is unfortunately very common (it may, for example, be a quick solution for a short-term requirement that works well enough to be somewhat useful).