Programming Requires Perfection

From DoesSoftwareQualityMeanNoBugs:

"Human beings are not accustomed to being perfect, and few areas of human activity demand it. Adjusting to the requirement for perfection is, I think, the most difficult part of learning to program."

I would say that it is not perfection that programming requires, but more like a kind of strict accountability. The computer will do exactly what I say, even if it's not what I mean. That doesn't mean I have to be any more perfect, as long as what I say gets me close enough to what I want. But it does make it harder sometimes to get what I want.

I think of it as "exacting precision" rather than "perfection".

The other demanding thing about computers is that they're typically discrete systems. In a continuous system, a small error results in a small deviation from perfect performance -- if you oversteer your car a little bit, your car moves out of the center of the lane a little bit. In a discrete system, though, a small error can result in a very big deviation from perfect performance: if your array indexing is off by only one, you end up going past the end of the array.

I think it was Rita Rudner who said: "When you dial a wrong number, and you're only off by one digit, I don't think you should get a whole different person!" You do, of course -- because phone addressing is a discrete system.

Regardless, if programming literally required perfection, I wouldn't be doing it.


It's possible to design sequences such that if "you're only off by one digit", you still get the same result as if you typed it in perfectly (HammingCodes). But that requires using a few extra digits. With only one extra digit (a CheckSum? or LRC or CRC), it would be possible to arrange things so that if "you're only off by one digit", you always get a "No one at that number" recording rather than disturbing some random third party.

I wonder if that would be better or worse than the phone number system we have now ?

-- DavidCary


The best thing about computers is that they do exactly what you tell them to do.

The worst thing about computers is that they do exactly what you tell them to do.


See PerfectProgram.


CategoryIdealism


EditText of this page (last edited September 30, 2009) or FindPage with title or text search