3 ms·
"It’s harder to read code than to write it." I think this really depends on the context. If I'm looking at the source code for openssh/encryption libraries,
by bobby_9x 11y ago
"It’s harder to read code than to write it."
I think this really depends on the context. If I'm looking at the source code for openssh/encryption libraries, it's much easier for me to read it, then come up with some of code on my own.
If I'm trying to wade through some 10-year old spaghetti code, it would be much easier for me to re-write it.
I think the main issue isn't that programmers "can't read code". It's that most programmers don't write code with the intention of having it read by other programmers.
I've been a developer for 15+ years and I can't tell you how many times I've worked on these sorts of nightmarish code bases.
- 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).