3 ms·
The worst code I've seen is from programmers who had no mental model of what they were doing, just changed things at random until tests passed. The worst writi
by dspeyer 15y ago
The worst code I've seen is from programmers who had no mental model of what they were doing, just changed things at random until tests passed.
The worst writing I've seen:
* is ungrammatical to the point of incoherency
* loses its train of thought mid-sentence and talks about
something unrelated
* is full of irrelevant details
* simply ignores everything above the sentence level, producing mere text, no argument, story or whatever it was supposed to be
Not really the same failure modes.
- michael_dorfman 15y agoNot really the same failure modes. Really? Because except for the first one (which we have compilers to thank for), your three remaining points apply equally well to a lot of code I've seen.
- lurker14 15y agoEven if you are working in a compiled language, you still can't always rely on the compiler. The compiler will not stop a programmer from writing invalid code, without any tests, and checking it into a repository, where it silently waits for an unsuspecting programmer to discover it months later.... "How do I do what I want here? Aha, someone already wrote ExactlyWhatIWantHere.... WTF, it doesn't even compile? But how is anyone using it? Oh, it's not being used anywhere? How the heck did it get here? Ugh..."
- yxhuvud 15y agoThe first point applies as well, to when his counterexample has happened. Who has not seen a piece of code that is so bad they don't even understand how it can compile, coming out of a newbie? Doing strange undefined things in C comes to mind as a usual case where this happens.