
Most Programmers Can't Read Code - ohjeez
http://www.gamasutra.com/blogs/RobertDieterich/20121122/182156/Most_Programmers_Cant_Read_Code.php
======
colund
Code is a function of requirements and special cases and the execution is the
output. Hence reading code without human communication does not tell the
original purpose. Reading code is about "what" and not "why". I don't like
this kind of articles which claim simplistic views on things as facts...

~~~
greenyoda
_" Hence reading code without human communication does not tell the original
purpose."_

Unfortunately, when code is useful enough to survive for many years, the
people who specified, designed and wrote the code are long gone by the time
some unfortunate developer comes along and has to understand the code (e.g.,
to add features or fix bugs). So being able to figure out the original purpose
of the code under such adverse circumstances can be a very useful skill to
have.

In a startup there isn't a lot of legacy code, but in big companies that have
been around for years or decades, old code like that is very common. (However,
even in a startup, you might need to be able to make sense of poorly-
documented open source code whose developers don't have the time to talk to
you.)

------
bobby_9x
"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
_" 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).

