The Boston Diaries

The ongoing saga of a programmer who doesn't live in Boston, nor does he even like Boston, but yet named his weblog/journal “The Boston Diaries.”

Go figure.

Tuesday, Debtember 04, 2001

Rememberances of code past

I did work at a company where I was helping to port their product from MS-DOS to Unix. One of the mantras at the company was Thou shalt not change code! And they meant it. And it was taken to silly extremes.

One example: filenames. Under MS-DOS the case of a filename given to MS-DOS doesn't matter as MS-DOS will convert it to uppercase, so specifying README or readme gives you the same file. Unix though, is case sensitive so README and readme are two different files. The company decided that all filenames under Unix were to be lower case, but at various points in the code there might be a file specified all in upper case:


dbf=dbopen("BBSUERS.DAT");

What you could not do was change the case of the filename:


dbf=dbopen("bbsusers.dat");

No. That might break. How, I don't know. But the mantra was Thou shalt not change code! So the proper way to do it was:


#ifdef MSDOS
  dbf=dbopen("BBSUSERS.DAT");
#else
  dbf=dbopen("bbsusers.dat");
#endif

Which makes the code harder to follow. Forget:


#if defined(MSDOS)
#  define F_BBSUSERS	"BBSUSERS.DAT"
#elif defined (UNIX)
#  define F_BBSUERS	"bbsusers.dat"
#else
#  error Please define filename for system
#endif

...

dbf=dbopen(F_BBSUSERS);

That's a major code change (even though it doesn't clutter the code flow with compilation changes). I do think that the Unix manager did manage to get:


char c;

changed to


typedef unsigned char Char;

...

Char c;

But that may have been the only concession to Thou shalt not change code! that was made at the company.

For some reason, I'm reminded of this because of Joel. Go figure.

Obligatory Picture

[The future's so bright, I gotta wear shades]

Obligatory Contact Info

Obligatory Feeds

Obligatory Links

Obligatory Miscellaneous

You have my permission to link freely to any entry here. Go ahead, I won't bite. I promise.

The dates are the permanent links to that day's entries (or entry, if there is only one entry). The titles are the permanent links to that entry only. The format for the links are simple: Start with the base link for this site: https://boston.conman.org/, then add the date you are interested in, say 2000/08/01, so that would make the final URL:

https://boston.conman.org/2000/08/01

You can also specify the entire month by leaving off the day portion. You can even select an arbitrary portion of time.

You may also note subtle shading of the links and that's intentional: the “closer” the link is (relative to the page) the “brighter” it appears. It's an experiment in using color shading to denote the distance a link is from here. If you don't notice it, don't worry; it's not all that important.

It is assumed that every brand name, slogan, corporate name, symbol, design element, et cetera mentioned in these pages is a protected and/or trademarked entity, the sole property of its owner(s), and acknowledgement of this status is implied.

Copyright © 1999-2024 by Sean Conner. All Rights Reserved.