From Visual Developer Magazine #48, February/March 1998


Unwarranted Assumptions



The real lesson in all the Y2K foofaraw is that as programmers we often have to compromise, and in compromising we sometimes have to guess—but in guessing we usually embrace unwarranted assumptions.

Come the last week of 1999, I'm going to take three weeks of vacation, and run the Jeep out along the Mogollon Rim, read a few books, and look at the stars. I've never been one for apocalypse, but I'm also a cautious kind of a guy. Furthermore, I've been a programmer, and like all programmers I've been guilty of unwarranted assumptions.

Back in the First Age, when Feanor was a mainframe programmer and RAM cost a dollar a byte, many of us saved our companies a considerable amount of money by expressing years in two digits, assuming that software written in the Sixties would never survive into the Third Millennium. We envisioned Moon colonies and personal mainframes no larger than washing machines, which would talk to us and accept programs spoken in plain English. Ahh, well. The future becomes the present at wildly different rates of speed.

Today, newly respectable COBOL programmers are poring over hex dumps, decompiling in their heads and looking for the hidden tracks of date math in 370 machine code. Nearly all of them are assuming that this is a one-off, a trick of fate that lurks nowhere else in the guts of the billions of lines of program code at work in the world.


Back in 1984, my old boss and PC Tech Journal editor Will Fastie had dinner with Bill Gates, and the talk turned to the now-forgotten 32-megabyte barrier. (For years DOS systems could not address hard disks larger than 32 MB.) Bill got a wistful look in his eye, knowing it was indeed his fault, as he said, "But who would have thought people would ever need more than 32 megabytes!" This from the man many claim can read the technological future like a book. (No, no, Jeff—like a checkbook!)

We who work on the desktop alone were unwittingly saved from a number of unwarranted assumptions when Windows conquered all and forced us to rewrite a great deal of hoary old DOS code from scratch. My old BP6 JiveTalk communications program used to check for disk space for downloads using long integers, and sure enough, it croaked when out of nostalgia I ran it on my current Pentium system with a 3GB hard drive. (A second unwarranted assumption I made in 1991was that our OS would always allow us to manipulate ports at the register level. Even if poor JiveTalk could have toted up its free space correctly, NT4 would have slapped its face when it tried to grope the UART.)

What else might be hiding in your Windows code? Do you do RAM math in long integers? 256MB systems are common on the high end. (I have 128MB myself.) How long before the first gigabyte RAM systems appear?

Programmers (especially FORTRAN guys of Feanor's generation) often used "99" to indicate an illegal value, especially for things that rarely if ever got up as high as 99. This includes date values. (Maybe I should take my Jeep trip at the end of 1998 instead.)

The year 2000 has an additional peculiarity stemming from a tiny delta in the speed of the Earth's rotation that is corrected once per century—by dropping Leap Year Day. Does your Y2K-savvy software know about this, or did you take LISP instead of astronomy back at Purdue?

What else are you counting? Screen dimensions? Are you sure we'll never have 32,768 pixels along an axis? Total screen pixels? A 32K by 50K screen comes perilously close to have MaxLongInt pixels. Care to bet how long it'll be before we get there?

The real lesson in all the Y2K foofaraw is that as programmers we often have to compromise, and in compromising we sometimes have to guess—but in guessing we usually embrace some unwarranted assumptions. Some of them come out in the wash, as architectures turn over, but others have this bad habit of leaving teeth marks in our hindquarters. As part of your next software quality review, how about an assumptions audit? Give it some thought. I'll be up on the Rim waiting for some of these unwarranted assumptions to blow over.