Cowboy programmers, or “It’s all going to have to come out!”

Programmers, like builders, are famous for holding each others’ work in contempt.  A new programmer arriving on an old job is likely to say, just like a builder: “What cowboy did this, then?” and “It’s all going to have to come out, you know!”, and most ominous of all, a non-verbal suck of the teeth and shake of the head.

Exasperating as this attitude is, I think there’s a good reason for it.  It’s got to do with the nature of programming itself.  See, by their nature, all programmers operate on the limit of their competence.  They wrestle with the problems they can see, and are oblivious to those they can’t.  Problems which they’e already solved on previous jobs: they barely even notice them.  Besides, that’s what cut-and-paste is for!

But another programmer, following behind, will almost certainly have a very different perspective. Problems which the first programmer found difficult and solved creatively, the second may consider obvious or else not see at all.  The things the first programmer missed entirely, the second may consider the crux of the problem or blindingly obvious.

Nine times out of ten,  a new programmer arrives into an old job because the job is going wrong, and everybody wants to believe in the incompetence of the original programmer.  And so, confronted by the honest and diligent effort of his predecessor, all a newcomer will see – all he would ever see – is ignorance and incompetence.  It may be that the newcomer is right, and the original programmer really was an idiot.  But, in all probability, they’re just looking at different parts of the one problem.


Advertisements

One response to “Cowboy programmers, or “It’s all going to have to come out!”

  1. There’s another reason: it’s easier to write code than read it. For instance, time yourself figuring out what this genuine and standard piece of code does:

    int partition( int a[], int l, int r) {
       int pivot, i, j, t;
       pivot = a[l];
       i = l; j = r+1;	
       while( 1)
       {
       	do ++i; while( a[i] <= pivot && i  pivot );
       	if( i >= j ) break;
       	t = a[i]; a[i] = a[j]; a[j] = t;
       }
       t = a[l]; a[l] = a[j]; a[j] = t;
       return j;
    }

    It’s like looking through the wrong end of a telescope and trying to figure out what country you’re in. But how long would you need to write a quicksort, and how confident would you be that yours worked?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s