Confessions of a terrible programmer

Chris Angelico rosuav at gmail.com
Fri Sep 6 13:43:32 EDT 2013


On Sat, Sep 7, 2013 at 3:17 AM, Joel Goldstick <joel.goldstick at gmail.com> wrote:
> On Fri, Sep 6, 2013 at 12:56 PM, Steven D'Aprano
> <steve+comp.lang.python at pearwood.info> wrote:
>> Not specifically about Python, but still relevant:
>>
>> http://blog.kickin-the-darkness.com/2007/09/confessions-of-terrible-programmer.html
>>
>>
>>
>>
>>
>> --
>> Steven
>> --
>> https://mail.python.org/mailman/listinfo/python-list
>
> Pardon me, but I completely don't get this article.  Let me in on what
> is supposed to be the joke please!

It's a "ha-ha only serious" article. The point is: You can't write
good code by being a good programmer. You MUST [1] acknowledge that
you write buggy code, and then code accordingly.

Sometimes you'll write bugs that result in egg on the face. I fixed
one this week that had been lying around for ages; if the user
provided a particular (and unusual, though not malformed) set of
input, and the program was running in the first hour after midnight
UTC on a Thursday, it would go into an infinite loop, because I'd
missed decrementing something. More often - especially if you do
things like the author there does - you'll have a program that bombs
really fast on startup, or at least bombs noisily when something goes
wrong. Those bugs are easy to find and, often, easy to fix. Those bugs
we can deal with.

The other point to note is that it takes a competent debugger to
figure out problems, and that's in many ways a more important skill
than writing code. Taking another example from this week at work: My
boss was tinkering with our AJAX system, using his Linux development
box and one of our Linux test servers. He clicks a button in either
Google Chrome or Iceweasel (Debian's old build of Firefox), the server
does stuff, and stuff happens promptly. He crosses over to his Windows
XP laptop to try the same button in IE8 (the oldest and stupidest
browser we support), and there's a 20-second lag before the server
does its stuff. But adding logging showed that the AJAX call was
taking less than a second, so it couldn't be that. Turned out the
request was given a job time based on the client's clock, which was 20
seconds ahead of the server, so the job got delayed by those 20
seconds. Would you, when debugging an AJAX+PHP system, think to check
if clocks are synchronized? Only if you know how to debug. Good
programmers can, and can pinpoint problems without looking at a single
line of code.

Claiming you'll write perfect code is arrogance beyond measure.
Acknowledging that there'll be bugs and building systems to cope with
(and remove) them is the critical humility for programmers.

[1] http://www.ietf.org/rfc/rfc2119.txt

ChrisA



More information about the Python-list mailing list