Practical Technology

for practical people.

September 26, 1992
by sjvn01
0 comments

Hunting Data on the ftp Line with Archie

Is there anyone alive who doesn’t thrill to the idea of exploration? While we can’t be Indiana Jones, it is possible to search for temples of software treasure in the Internet. To computer fans, a new program or an interesting data file can be as exciting as any golden idol. And, besides, we never ever have to run into snakes!

In our last go-around, I explained the basics of using ftp (file-transfer protocol) to find and download files from Internet sites. Thanks to sites that allow anonymous ftp logins, it’s possible for anyone with net access to download files… if you know where to find them.

While ftp enables you to search around in a public directory for files, if the files you’re looking for aren’t there, hunting for them won’t do you much good. Worse still, it can be like looking for specific file can be like looking for a needle in a haystack. The virtual universe of cyberpunk science-fiction is already with us in that the Internet really can be a confusing and confounding maze.  Fortunately, for all would-be network explorers, there’s a faithful guide to lead you through the deepest, darkest network nodes: archie. Archie is a database program that does the hard work of finding and indexing files throughout the Internet. Instead of tracking down elusive files on your own, you can contact an archie site and use archie to find your elusive quarry.

Archie sites are scattered across the world. [See Table 1] While you can use any archie server, it’s fair play to use the one for your geographical area. Not only should this take up less online time, but by spreading out the load, the service is more likely to avoid being overburdened.

To use archie, you have three choices. The most popular one is to use telnet to contact the closest Internet site with a copy of archie. To perform a search, you’d go through a process like this:

telnet archie.sura.net

When you have a connection, you then login as “archie.” You will not be asked for a password. The next thing you’ll see in a prompt like:

archie:

From here on out you’ll be talking to the archie program rather than the operating system the way you normally do with telnet.

The first command you should enter is:

archie:; show

This displays all of archie’s settings. For the most part you can ignore these, but two you may care about are pager and search.
Pager tells archie whether you want it to dump its results to screen or whether you want it to wait for either a carriage return or space bar after filling the screen. If you’re unable to scroll your screen back to catch something that just disappeared off the top of your display, set the pager on with:

archie: set pager

Search defines how archie goes about looking for your entry. Different archies have different search defaults. For example, some default to case sensitive searches, while others could give a hoot as to whether your search string is in all caps or all lower case.

If archie comes back with a search value of “exact” then you’ll know that’s it currently set to find only exact case matches. That is to say, a search for CHess would not find Chess. File names being what they are, that probably isn’t what you want.

You can set this parameter to your liking with the command:

archie: set search X

X can have one of four values. Exact, we’ve already seen, your other choices are: regex, sub, and subcase. When you use regex, the search string works like a Unix regular expression. In short, wildcards like * and ? are allowed. I could search for Ch* and get all references to Chess or Chessmate. Unfortunately, I’d also miss CHESS.

If you search using sub, your expedition will find any program names that contain your search phrase regardless of case. For instance, a search with “CH” would now uncover Chess and CHESS. It’s also going to dig up files with words like patches or PATCHES in the title. Sub is very powerful but it can deluge you with false hits, i.e. files that contain your search string but have nothing to do with what you’re actually looking for.

Subcase works like sub but is case sensitive. Regardless of which method or methods you use, the most important thing you can do before beginning an archie hunt is to decide how you want archie to look for a file before beginning. You’ll not only save your own time, you’ll save everyone’s time.

Now, you’re finally ready to start a search. Searching is done by simply entering:

archie: prog search_string

Archie then proceeds to give you a running score on how many hits its found and the percentage of the database that has been searched. After that, archie reports on the files that meets your specifications.

This is done by presenting you with a listing describing the files’ location. This list comes in a multi-line format. At the top of each record is the site name for the system with the file. This is followed by the file’s directory and finally the file’s name along with some size and date information.

Without telnet access, you may still be able to use archie with a local archie client. In this case, you’d just run archie from your system’s command line. This is the best way to use archie since it saves wear and tear on the network.

You’re not out of the hunt even without telnet or a local archie. Archie can be used by mail. To do this you send a message to an archie site addressed to archie. For example:

archie@archie.rutgers.edu

In the text of the message you enter archie commands. A sample search message could look like

path you@your.mail.address
prog what_ever_it_is_you’re_looking_for
quit

That’s it. The first line tells the system where to send its findings. Archie can read your from line and would normally send its results there, but its safer to use the path command. From lines can be misleading.

The prog line gives archie its search orders. The default for mail searches is regex, but you can reset it using the normal commands. Quit does what it sounds like. If there was nothing else in your message, you wouldn’t need it, but since many people have .signature files, which are automatically added to the end of their messages, it’s a good idea to use quit.

Once you have the file name and the location, you can use anonymous ftp to retrieve the file. Suppose, however, you don’t have ftp access? Sometimes you can use mail to obtain files even though without full Internet access.

There are three ways of doing this. Some servers are set up to respond specifically to mail requests for files. Others, especially on BITnet, have listserv servers that use a different method for file requests, but like direct mail requesters, are limited to local files.

In a mail request, you get a file by sending a message to the site with your request in the subject line. Such a request might look like:

To: mail-server@some_machine.somewhere.edu
Subject: send /directory/file_name

And that’s all there is to it. You put absolutely nothing in the text part of the message.
For a BITnet system, your message would run:

To: listserv@an_ibm_mainframe.somewhere.com
In the message body, you’d write
get file_name file_type

Since BITnet runs on IBM VM systems, file type is mandatory.

More generally useful are ftpmail application gateways. The most popular one is ftpmail@decwrl.dec.com. Just to make things annoying, it uses ftp syntax rather than anything that looks like the first two methods. A sample of this:

To: ftpmail@decwrl.dec.com
Subject: File Hunt
connect system.somewhere.com
chdir pub/file_location
get file
quit

Subject is actually irrelevant, but it can help you remember what’s that large, mysterious looking letter in your mailbox is. The important part is that you enter ftp commands, (be careful of typos!) one command per line, in the text.

Presuming that everything went right. You can expect to see your file in anywhere from a few hours to a few days. Speaking of getting it right, you can always send the single command ‘help’ to any of the mail servers or archie to get more help.

A version of this story was published in Feb. 1993 in Computer Shopper

August 1, 1992
by sjvn01
0 comments

Getting the Data Through: Unix & Interoperability

Historical note: It was in this article that I first referred to Linux in print.–sjvn

There I was buried in a copy of Andrew Tanenbaum’s “Modern Operating Systems” when a friend woke me up with an unusual request. He wanted to move data from his Tandy Color Computer II disks to MS-DOS-format disks.

For those of you who don’t remember the “CoCo,” it was a popular home PC in the days when CP/M systems walked the earth. Its disks, I might add, are totally incompatible with Unix or anything else like a modern operating system.

After about an hour or so of searching, I found an MS-DOS program that could read CoCo disks. As I’ve said before, I may not be a computing wizard, but I do know how to find information in a hurry.

Getting Along

In the process, though, I started thinking about interoperability, a subject near and dear to my heart. Now, interoperability is a nine-dollar word which refers to programs and data that can get along with each other. Unix, which runs on everything from an XT (boy, is it slow) to a supercomputer, is the ideal operating system for interoperability. At the lowest level, interoperability simply means the ability to transfer data from one system or program to another.

Even at this very basic stage, however, there are almost endless complications. Take, for instance, an ordinary ASCII file. Now, you may think that an ASCII file is an ASCII file is an ASCII file. Even leaving extended ASCII out of this discussion, there are still critical differences in how operating systems treat ASCII.

Let’s get down to specifics. In Unix, lines of text always end in a line feed, ASCII character 13, or the character you get when you press Ctrl-J. In MS-DOS, the default for ASCII files is for lines to end in a carriage return, ASCII character 10 or Ctrl-M, followed by a line feed.

You might think, “So what?” but the actual consequences can make you want to rip your hair out. For example, another friend uses an MS-DOS computer to read Usenet news groups on a Unix system. Her problem is that when she tries to print interesting messages, her printer treats the Unix-based messages as one incredibly long line. The output is, shall we say, ugly.

Fortunately, Unix has an abundance of tools that can handle her problem. The easiest one to implement makes use of Unix’s pattern-handling language: nawk.

Was It Something I Sed?

Nawk is a newer version of awk, which just goes to show that Unix programmers can’t resist bad puns. The awk family is the most sophisticated of the standard Unix utilities.

In Unix terms, nawk is a filter program. You put raw, unprocessed data in one end of the filter, and get processed information out the other end. Other examples of filters are sed and grep.

Sed, Unix’s stream editor, would seem to be the most logical choice for this job, but it has one major flaw. Getting sed to accept carriage returns in a command argument is like trying to move a mountain.

For doing things like changing “shopper” or “shopper” to “Shopper” throughout a manuscript with one command, sed can’t be beat. We have to look farther afield, though, when it comes to dealing with line endings.

Usually, filters are used in processes where the data is on its way from one program to another. The filter merely processes the data and moves it down the line to the next step. Nawk excels at this when dealing with database data, but nawk also lends itself well to file-format translations.

Practice

Let’s return to the simple case of moving Unix files to DOS format. The nawk program, utodos, looks like this:

Begin {FS = “unkeyable n”; RS = “unkeyable n” ORS = “unkeyable r unkeyable n”}

{print $1}

This program is invoked by the following command:

nawk -f utodos input_file output_file

Now we’ll break the program down. In the first line, we’re redefining several default variables that nawk uses. FS (Field Separator) and RS (Record Separator) are set for the value of the new line character. ORS (Output Record Separator) is, in its turn, set to a carriage return followed by a new line.

The second line tells nawk to output each line, which, thanks to FS and RS, is treated as a single field record, with the new ORS. In other words, the file is transformed so that everything that Unix sees as a line will also now be seen in MS-DOS as a line of text.

As we’ve seen in previous columns concerning shells, dollar signs and numbers are used as variables. In the awk family, $1 is always the first field. Since each line is treated as one large field, this last command obligingly prints out each line.

When I invoke the command, I use the “-f” flag to inform nawk that it will find its marching orders in the otodos file. After that, the input file name follows and “>” redirects the output from the default output, normally the console, to a file.

Other Transportation Problems

Other data-transportation problems are even easier. Say, for example, that I want to move a dBASE IV database from where it lives on my Gateway 2000 running Interactive System V Release 3.2 Unix to my Dell running MS-DOS 5.0. This is no trouble since the databases’ structures are the same. My only problem is actually moving the file from one format to another.

One way I could do that would be to back up the database to a tape that some MS-DOS utilities I have could read. Last time around, I talked about using Unix’s own tools to make a home-grown backup program. That program can be used to solve this problem.

There are ways, however, that it could have been written that would have made it unusable. There are almost as many flavors of Unix as there are of ice cream. While a Bourne shell program will work on nearly all of them, the results may differ radically from system to system. For instance, the heart of my backup program is the line:

find . -type f -print – cpio -o > /dev/tape

Readers who know their Unix commands well will remember that the find command has a -cpio flag of its own. In other words, instead of having find locate the appropriate files and pipe them to cpio to be shipped off to tape, I could have find do all the work. The command line would look like:

find . -type f -print – cpio -o > /dev/tape

So why didn’t I do it that way? The main reason is portability. Many versions of find’s -cpio flag produce non-ASCII headers. These headers make perfect sense to their creating program, but are arrant nonsense to everyone else’s software. For these reasons, using cpio the program, not the flag, is key for interoperability.

Final Notes

I’ve barely scratched the surface of interoperability, but I’ll be coming back to it. In a world where sharing information becomes more important every day, interoperability is vital.

All this talk about Unix, however, doesn’t do you any blessed good if you don’t have Unix. New low-cost (would you believe free?) Unix-based operating systems are on their way.

One system, named Linux, will cost you only download fees and not even that if you’re on Internet. In its current version, this 80×86 Unix-clone is still only for the adventurous. If you want to give it a try, check out information on this system in the net news group comp.sys.linux. Many Linux files are also available on the Programmer’s Corner BBS.

June 1, 1992
by sjvn01
0 comments

Cache 101: What your Mother should have told you

The easiest way to give any computer more oomph is to add a cache. In the eternal race of CPU vs. memory access speeds, CPUs win hands down. Modern CPUs need information faster than memory can provide and much faster than hard disk allow. The way to provide datastarved processors with their minimum daily requirement of bytes is to dedicate a high-speed chunk of memory to storing information for the CPU: a cache.Normally, we think of caches as speeding up disk accesses by storing high-demand information in RAM memory where it can be snagged in nanoseconds instead of milliseconds. While this is important, caches are equally vital for supplying the CPU with data faster than it can be accessed from main memory.

When processors clunked along at a measy 10MHz, memory caching wasn’t that important; everything in the system was slow. With the coming of faster processors, like the 80386, those days are gone. CPUs were forced to wait for a clock cycle for data hence the phrase “wait state.”

Let’s look at a real-world example. A 25MHz 386 has a clock cycle time of 40ns. That’s the least amount of time the CPU needs for its fastest instruction. Usually, the CPU takes two cycles to read or write to memory. To keep up with the CPU when running flat out, you would need memory with 80ns access times. Which, as it happens, is perhaps the most-common fast dynamic RAM (DRAM) around.

Unfortunately, it isn’t that simple. DRAM has to be recharged every time it’s used, and the recharge time is typically 90 percent of the access time. Get the picture? An 80ns DRAM chip has a cycle time of 152ns. That’s already too slow, but DRAM has to pay another performance penalty: DRAM chips must be refreshed frequently or they lose their stored data. Typically, this puts about an additional 8 to 10 percent bite on performance. Ouch.

There are ways around this problem. Interleaved memory separates memory into banks. In motherboards with two banks, even-numbered memory locations are assigned to one bank while their odd-numbered brethren are assigned to the other bank. When data is read sequentially, this reduces wait states since data is picked up first from one bank and then the other. This gives each bank enough time to take care of its housekeeping chores before being called on again for access.

Data isn’t always accessed in such a straightforward manner, however. When it’s not, and the CPU needs data kept in two different locations in the same bank, the CPU will again waste clock cycles waiting for memory.

PAGING COMMANDER DATA

Paging is another attempt to overcome memory speed hurdles. In paging, memory is addressed not by absolute location, but by memory sectors of “pages.” Data addresses in memory aren’t shifted dynamically, instead, the memory address is static, thus this scheme’s other name, ‘static column.”

As long as the data can be found in a single page, typically 2K in size, the system doesn’t waste time. Once the CPU asks for data outside the current page, all the usual problems of slow memory reappear.

While both interleaving and paging help, neither is enough to avoid wasteful wait states completely. In fact, they’re often combined to wring the most benefit from each approach, but caching is the solution most effective at eliminating all but a fraction of performance-draining wait states.

Cache success is usually measured by the percent of memory accesses that find a needed byte of information in the cache. Every time the CPU gets the required data, the cache is said to have a hit. Cache efficiency is judged like a baseball player’s batting average. The number of hits compared to the number of times the CPU asks for data gives the cache its “hits ratio.” Unlike Wade Boggs or George Brett, an average hovering around .350 stinks for a cache. Successful caches should have a hit ratio above 90 percent, or in baseball terms, a cache should bat above .900. Ted Williams, eat your heart out.

It takes more than a high average to make a good ballplayer or cache, though. An all-star cache needs a good balance of four factors. These are: 1) hit ratio, 2) hit speed, 3) miss speed, and that all-important one, 4) cost.

Hit speed refers to how fast the cache can come back with data if it has the information in storage. Faster is always better here. The Ricky Hendersons of caching use 20ns SRAM. Unfortunately, SRAM, like star base stealers, don’t come cheap. No one ever said making an MVP cache was easy.

Miss speed is how long it takes a cache to report that the requested information isn’t within its confines. Slow miss-reporting can put any cache on the disabled list.

Cost can never be overlooked. Designing the best possible memory system is really quite simple: Just use the fastest SRAM you can find, get a good caching algorithm, and make it serve as both primary and secondary storage. The rub is that you’ll feel like you’re paying Darryl Strawberry’s salary out of your budget. It simply isn’t feasible to build this kind of system–the cost is too high.

CACHE TRADE-OFFS

For both developers and end users, cache size is often the first consideration. Arguments have raged for years over how big cache should be. The answer, and you’re going to hate this, is that it depends. There isn’t even a good rule of thumb. Bigger is better (the most often quoted guideline) is only true up to a point before you get into diminishing returns.

A cache’s hit ratio depends on a delicate balance of elements. At least as important as cache size is the size of data elements within the cache. These elements are called “data lines.”

In a simple cache, when the CPU calls for data, the cache controller–or memory management unit (MMU)–searches a tag list. The tag list can be thought of as an address list. Each tag is attached, by either pointers or a linked list, to the appropriate data line. Longer data lines increase cache efficiency more than large cache size. A 64-byte data-line design, for example, should be almost an order of magnitude more efficient than a 4-byte design in a 64K cache.

Again, though, there’s no easy way of determining the right mix of data-line length and cache size. The type of application and how these applications access memory are as important as any design considerations in finding the best possible cache. Compromise is a way of life in everything.

CACHES AND STILL MORE CACHES

Caches are classified by how they address data storage. The quick and dirty way is direct mapping. In direct mapping, the cache’s data lines have a one-to-one correspondence with the data addresses in memory or storage.

While direct mapping is popular, it has a weakness. Since the cache is usually smaller than memory, and always smaller than mass storage, each direct address line in the map corresponds to more than one section of memory. When the same cache line is used to refer to more than one part of memory or storage, performance drops through the floor. Adding insult to injury, this occurs even if there’s still free room in the cache.

Consequently, designers have looked at fully associative caches. In these designs, cache data lines are assigned dynamically. While these caches have great hit ratios, the designs may not be as fast as a direct-mapped system’s hit. The reason is that although an associative cache can adapt to your CPU’s memory demands, it takes slightly longer to find the required data.

For example, in a direct-mapped cache, the cache controller always knows where to go for a particular chunk of information. That information may not be in the cache, but the controller doesn’t need to waste time looking any further. An associative cache program can’t make that assumption, so it must search through the entire cache in poor implementations, or a lookup table in better schemes, before reporting a miss.

Set-associative caches attempt to get the best of both worlds. The best known examples of this kind of caching are the Intel 82385 cache controller chip and the 80486’s internal 8K cache. The Motorola 68040’s internal cache is even more sophisticated. It breaks the cache into one area for data and another for instructions for faster performance.

The 486 uses a four-way set-associative design. The 8K cache is treated as four 2K blocks. Each block is made up of 128 16-bit-wide data lines. Within the block, the data lines are bundled together in 32 four-line sets. These sets correspond to absolute memory addresses the same way a direct-mapping cache would. At the same time, the data lines within a set can be dynamically set to any data within the set’s fixed range.

The resulting cache has the quickness of direct mapping combined with the flexibility and high hit rates of fully associative caching. It should come as no surprise to learn that set-associative caching designs can be found in most cache controllers.

ALGORITHM DU JOUR

There are other important performance issues. One of the most critical is when to fetch data from memory or storage. Some algorithms only call for data when it has been requested and hasn’t been found in the cache. Other algorithms try to predict what information will be called for next and request data before the CPU calls for it.

The idea of pre-fetching data is an attractive one, but it’s not easy to make it work effectively. After all, if the cache guesses wrong, time is wasted not only extracting data but dealing with the excess baggage of unwanted data. Worse yet, you may have gotten rid of needed data to make room for useless information.

Data-line length must be considered even more carefully thanusual in pre-fetch designs. Longer data lines, for instance, can lessen a cache’s efficiency by wasting space when unneeded data is loaded.

Pre-fetch systems usually rely on the fact that if the CPU just called one block of data, the odds are that the next block asked for will be the following sequential block. For instance, many disk-caching programs read an entire track of data. The software is betting that the data is unfragmented on the disk and that the CPU will soon need the information stored in the next sector. With a sufficiently large cache (larger is better here), cache performance can drastically improve the cache’s hit ratio.

It sounds great, but this one-block lookahead approach can increase traffic on both the bus and in memory. If you’re running a multiprocessor system, like some Compaq Systempros, or already pushing the bus’s bandwidth to the limit with multimedia applications, this method will start degrading overall system performance.

A more sophisticated approach is to pre-fetch only after a miss. There’s no such thing as a free lunch, however, and the check here is an increase in I/O traffic and a decrease in cache hits compared to always pre-fetching. In short, you don’t put as much of a burden on the bus or memory, but you don’t get as many hits either.

Even more sophisticated caches pre-fetch data not only on misses but when there’s a hit on a pre-fetched data line. In other words, the cache anticipates that when the CPU asks for new data, it’s likely to want other data associated with its new inquiries.

Another consideration is whether both the cache and memory should be searched concurrently. Most caches are “look through” designs. In this case, main memory isn’t searched until a miss has been reported. Some designs, called “look aside,” search both the cache and memory simultaneously.

There are several pitfalls to be wary of in the look-aside approach. The cache controller must be able to manage both searches and resolve any conflicts. This is perfectly possible, but the controller must be more powerful than its look-through brother and the cache’s code must be more tightly written. In layman’s terms, this means more things that can go wrong.

All caches have to deal with the problem of throwing out the trash, i.e., stale data. A cache only has so much room, and when it’s full, room must be made for new data.

This problem can be attacked in three ways. The first has the advantage of simplicity. The cache simply throws data out at random. It works, it’s easy to build, and it’s a lousy way to keep up your hit ratio in large caches. Curiously enough, studies show that in certain kinds of small caches, random replacement works better than other approaches. Random replacement can’t be dismissed out of hand.

The next method can also be put together by almost any tinkering programmer. This approach uses the tried and true first-in, first-out (FIFO) concept. Data moves through the cache in an orderly fashion. The oldest information is thrown out as new information comes in.

Developers are never content simply to use easy methods. Programmers have been working for years on implementations of least recently used (LRU) algorithms. In these schemes, the data that’s thrown out of the cache is the data which has gone the longest without being used. When properly implemented, LRU is the most successful approach for most caches.

That’s easier said that done. LRU has two strikes against it. First, every data line must have counter bits. After all, you need some way of telling which data line was accessed last. Second, the cache controller or program has to burn time deciding what’s the least-used data.

TO WRITE OR NOT TO WRITE

The most heated issue in cache design is when to write data. The belts-and-suspenders crowd believes in “write through.” In this approach, there’s no question about it–when you make a change to data in the cache, the change is immediately passed along to memroy and/or the mass-storage device. Of course, while this is happening, the processor is spinning its wheels waiting to get back to work.

That’s why some designers take a different tack. Their approach is “posted write,” also called ‘write back.” In this method, changes are posted to the cache at top speed, but the cache controller waits until it is idle to write the change to memory.

In posted write, there are two methods of handling data writes. In “always copy-back,” data is written to memory eventually even if the only change is that a line of data has been moved out of the cache. The other approach, “flagged copy-back,” calls for changes to be written only if the cached information has been changed.

No matter which way you go with posted write, there are some unavoidable problems. The one that makes users sweat is that out-of-date data can be held in memory for up to seconds at a time before the cache updates the stale information. If your system happens to get hit by the mother of all power surges, you can kiss that information goodbye.

What’s that you say? You have an uninterruptable power supply and don’t need to worry about a blackout? Well, there’s another dimension to this problem that doesn’t get mentioned often. Other devices in or attached to your computer also access memory through direct-memory access (DMA). this can bypass not only the CPU but the cache and its controller as well.

As a result, your FAX card or modern may pick up wrong data. This can foul things up completely. Or a peripheral can change data in main memory, thus once more throwing a monkey wrench into your system’s memory management.

There are ways to tackle this problem. The i82385, as well as the 68040, use wha’s known as “bus snooping.” By watching all memory transfers across the bus, both CPU and peripheral initiated, DMA changes can be recorded property in the cache.

One must wonder, though, if the benefits of posted writes are worth the trouble. At the outside, only 15 percent of your data transactions are writes. The rest are reads. It hardly seems worth exposing your data to any danger to speed up such a small percentage of data transactions.

CACHE COHERENCY

Some trouble with keeping data current is unavoidable in modern systems. As chips that feature onboard caches like the 486 and the Motorola 68040 become more common, this problem will pop up more often. Now computers frequently have chip-, controller-, and software-based caches. This is fine, but how do you get three different caches, memory, and storage all to agree on the state of any given byte of accessed data? In other words, how do you keep data coherent? There are no easy answers.

For today’s solutions, most software and hardware rely on bus snooping with write-through techniques. There are other approaches, but they belong more to the realm of theory than practice. This will change since the ever-increasing speeds of processors demand higher-performing caches.

With many cache-design elements, trade-offs are difficult to make and hard to optimize. It’s no wonder that there’s such as profusion of caching software and hardware. Nonetheless, several practical lessons can be drawn from cache theory.

The first lesson is that every computer needs a cache. Even if the memory can keep up with the CPU, the hard and floppy drives won’t be able to. There’s no better way to give your PC a kick in the pants than to add a cache.

A cache doesn’t need to be big. While trial and error is the only way you’ll discover what cache size works best for you, more than 2Mb of cache will be overkill on most systems for most applications. Like so many other things in caching, even this vague rule is not written in stone. Multiuser systems or file servers probably can use all the cache you can stuff into them.

Cache design is more important than size. The only way you’ll be able to judge that is from head-to-head comparisons of caches. Cache designers don’t give out their recipes, and it wouldn’t be much help even if they did. There are so many cache-design considerations that the only way you can tel what works for you is to give each cache a try.

The one design issue that users can sink their teeth into is memory-update policies. When you need the fastest possible cache, copy-back designs should be what you look at first. Everyone else would be better off with write-through designs.

One issue that I haven’t touched on is hardware caches vs. software caches. For memory/CPU consideration, hardware caches are the only answer. When it comes to caching data from disks, however, it’s another story entirely.

Hardware caches, such as those found on caching controllers, tend to be faster than software-based caches and particularly shine at writing data. Yet they cost three to four times the price of a caching program. For most users, software caching paired with additional motherboard RAM is a clear win. Network and multiuser operating systems will be better off with hardware caches.

Good caches may be difficult to make, but their value is indisputable. It’s clear that the future will continue to bring caching improvements as developers continue to wrestle with the difficult decisions required to make successful caches. As users, we will all benefit as caching technology matures and becomes more tightly integrated with system design.
First published in Ziff-Davis’ Computer Shopper

January 22, 1992
by sjvn01
0 comments

Windows for Workgroups: Hauling the Data on the Microsoft Line

Once more into the breech! Microsoft, after years of playing second fiddle to Novell in the LAN market, now enters the networking battle field with Windows for Workgroups (WinWork). WinWork adds peer-to-peer networking functionality to Windows 3.1.

This bold combination of today’s most popular graphical user interface (GUI) and LAN-capability bids to tilt the network playing field in Microsoft’s favor. Or, at least that’s what Microsoft hopes anyway. The reality is somewhat different.

Continue Reading →

September 1, 1990
by sjvn01
0 comments

Relational Databases: The Real Story

Did anyone else notice a few months ago when every food product in the land was advertised as “Light?” It didn’t matter a darn if there was any truth to their claims. Light was the new hype phrase and so everyone used it.

Breakfast cereals, margarines, and even ice creams were all advertised as being light. They got away with it because while you may think you know what light means, for advertising purposes it’s an ambiguous term. Food advertisers aren’t the only ones to play fast and loose with language, computer companies do the same thing.

Instead of “light”, buzzwords like “turbo” and “object-oriented” bombard us. One term with a precise definition has been bantered about so often that even computer veterans have lost track of its meaning. That phrase is relational database management system (RDBMS).

Companies have been using this phrase for years. There’s only one problem: few programs come even close to being relational database managers.

Thanks to their efforts even database professionals believe that RDBMSs are any program that can access more than one database at a time. Nothing could be further from the truth. Just because a program allows you to view two different tables with its procedural language doesn’t make it relational.

The sad thing about this is that there’s no real excuse for this confusion. The relational database model has been around since 1970. In that year Edgar Codd introduced it to the world in his classic paper, “A Relational Model for Large Shared Data Banks” in Communications of the ACM. Since then he and his cohort have been beating the drum for RDBMS both within and without the walls of IBM. To make certain that everyone got the idea, Codd summed up the definition of RDBMS in twelve rules.

These are:
In a way it’s funny that so many programs try to wrap themselves in the RDBMS mantle. During its first years of existence, nobody except Codd and company supported the RDBMS model. RDBMS, based firmly on mathematical theory and predicate logic, was disliked for its break with traditional database thought. It was reviled as being too theoretical. Many said that it would never be practical. Whoops!

The prevailing database model of the late 60s and early 70s was the hierarchical one. In this still popular system, data is stored in a tree structure. Every data element is defined as being a member of a group in this arrangement. These groups are themselves data elements and can be members of a higher group.

Under this scheme, your zip code is a data element is part of another data element, your address. This could then be a part of another data element, a mailing list for instance. These structures can grow quite complicated and require pointers and indexes to properly track information.

RDBMSs take a much simpler view of data. In a relational database, two dimensional arrays of rows and columns hold all information. This seems too easy and to some extent, that criticism is valid. Not every kind of information can be easily accessed under a RDBMS. Imaging information, for instance, doesn’t easily fit into a RDBMS’ neat patterns of data. Still, a RDBMS works fine for most textual or numeric data. The structure may be simple, but the data retrieval and manipulation powers inherent in it are unparalleled.

In part, this is because RDBMS theoretical underpinning allows for much easier coding. For example, finding records between two points, say all names between Vau and Vo, is a breeze in a relational system. The same search in conventional databases requires many record by record comparisons.

Even the most complicated data relationships can be reduced to two-dimensional table formats in a process called data normalization. This format makes changing and displaying information far easier than under a hierarchical system. The fundamental improvement of a RDBMS is that data can be added, deleted, or changed throughout an entire database by treating it as a single set. Ordinary database managers require record by record updates that drastically slow down performance.

The RDBMS concept sounds easy, but its full implementation does t more difficult to do in practice than in theory. The RDBMS complete definition contained within Codd’s 12 rules has proven difficult to achieve. Any database manager that claims to be relational must conform to the complete dozen. So far [1990] none have.

There are a few which have come close. IBM’s mainframe driven DB2, Ingress, Oracle, and R:Base 3.0 all attempt to meet the demands of the RDBMS model. At one time Codd stated that a relational database manager needed to meet only seven of his rules. By that standard, some have been successful. In order to understand why this has proven so hard to do, a review of some of these laws is in order.

First, here are the laws:

Rule 1: The Information Rule
All data should be presented to the user in table form.

Rule 2: Guaranteed Access Rule
All data should be accessible without ambiguity. This can be accomplished through a combination of the table name, primary key, and column name.

Rule 3: Systematic Treatment of Null Values
A field should be allowed to remain empty. This involves the support of a null value, which is distinct from an empty string or a number with a value of zero.

Rule 4: Dynamic On-Line Catalog Based on the Relational Model
A relational database must provide access to its structure through the same tools that are used to access the data.

Rule 5: Comprehensive Data Sublanguage Rule
The database must support at least one clearly defined language that includes functionality for data definition, data manipulation, data integrity, and database transaction control.

Rule 6: View Updating Rule
Data can be presented to the user in different logical combinations, called views. Each view should support the same full range of data manipulation that direct-access to a table has available.

Rule 7: High-level Insert, Update, and Delete
Data can be retrieved from a relational database in sets constructed of data from multiple rows and/or multiple tables.

Rule 8: Physical Data Independence
The user is isolated from the physical method of storing and retrieving information from the database.

Rule 9: Logical Data Independence
How a user views data should not change when the database’s logical structure (tables structure) changes.

Rule 10: Integrity Independence
The database language (like SQL) should support constraints on user input that maintain database integrity.
” No component of a primary key can have a null value. (see rule 3)
” If a foreign key is defined in one table, any value in it must exist as a primary key in another table.

Rule 11: Distribution Independence
A user should be totally unaware of whether or not the database is distributed

Rule 12: Nonsubversion Rule
There should be no way to modify the database structure other than through the multiple row database language (such as SQL).

Now, let’s dive in. The fundamental rule of RDBMS is that all information must be manageable entirely through relational means. This means that on the logical level everything in a relational database must be represented by values in tables. Here is where many database managers fall short. It is all too tempting to take a short cut in data representation or manipulation for the sake of short term efficiency. Unfortunately, this easy road leads quickly away from the basic model.

Other rules re-enforce this concept. In a true RDBMS, the database description, or catalog, must be contained in tables and be controlled by the data manipulation language.

Perhaps the most troublesome rule here is the number three which deals with nulls. In a RDBMS, nulls represent missing or inapplicable data. They are a vital part of the relational concept. This isn’t the same thing as empty or blank fields or the concept of zero.

If that sounds confusing, you’re right, it is. English isn’t the appropriate language for discussing the issue. To make it clearer, here’s the best definition I know for the concept. Null represents information which isn’t known at the time of the record creation or modification. For instance, a hospital keeps birth records. Sometimes happy new parents don’t have a first name for their little darlings. Now, there are several ways this could be handled in the hospital files. The baby could be given a false name, “John Doe” or “Smith’s daughter” and the record changed latter to the true name. This will work but it makes both record updating and reporting more complicated. Under a RDBMS, the missing information is represented by the null value.

The problem with this is that even within the relational framework there is no agreement on how to manipulate record sets containing null values. Debate rages on what to do with nulls. Since it’s at the heart of the theory, it can’t just be disregarded. For example SQL, sequential query language, the most popular relational language, identifies primary record keys by the combination of their unique identity and by being “not null.” How do you handle a situation where the primary record key includes a null value? That’s a good question with many ways to answer it.

The waters have been further muddied by Codd’s suggestions that two types of nulls should be recognized. One would represent missing information and the other inappropriate data. There’s no sign that a definite answer on this thorny question will be quickly forthcoming. [January 29th, 2008, we’re still no closer to a universal answer.]

Another rule that has proved difficult to implement is that a RDBMS must have distributional independence. In other words, the data manager must be able to cope with distributed databases. A true RDBMS shouldn’t care if the view on your screen is made up of a table from your PC and another from a VAX across the country.

As any database manager watcher knows, this is one area where progress is rapidly being made. Database servers and clients are the hottest development in the field. The RDBMS model is largely responsible for this. Its simple design and data integrity rules have made it the cornerstone of most such schemes. [In 2008, this issue has long been solved. How to handle replicating date in case of a disconnection or data corruption remains a practical problem, but the core design problem has long been solved.]

You might think that you could combine the best features of a RDBMS with other systems. Many software companies have thought just that. They’ve tried to put a coat of relational paint on top of other systems. Codd addresses this with his final rule. The gist of which is that if a relational system does have an ordinary single-record-at-a-time language it can’t be used to detour around the system’s relational rules. Sour grapes over the spread of programs that did just that wasn’t the reason for this final commandment. The relational model is fundamentally different from other ways of viewing and manipulating data. A true hybrid system could never produce the full gains promised by relational theory.

In some circles, talking about database theory is like talking about religion or politics: you’re sure to have an argument. I’m in favor of the relational model, but I’ll be the first to admit that it has some problems. There are still grey areas, like nulls, that need a clearer definition. There are practical problems as well. RDBMS require comparatively large amounts of RAM and disk storage. To put it more bluntly, they tend to be resource hogs. It should also be considered that for many purposes there’s nothing wrong with hierarchical systems.

Most flat file database managers work quite well within their theoretical constraints. In point of fact, most database programs, including such popular favorites as dBase, FoxPro, Clipper, Superbase, and Paradox owe more to this model than they do to the relational one. Still, as time goes by the theoretically superior relational model will be successfully implemented on more platforms. Then, and only then, will we have products that can honestly be presented as being relational.

Until that time, the best that can be said of most programs is that they include some relational features.

Today, in 2008, most serious DBMSs–MySQL, Oracle, PostgreSQL–are while not perfectly relational, are based in large part on Codd’s rules.

A version of this article first appeared in Byte Magazine in 1990.

January 1, 1983
by sjvn01
0 comments

Real Men Don’t Use Pascal

This isn’t my work. It’s by Ed Post, and it started as a letter by Post to Datamation. Enjoy!

Back in the good old days — the “Golden Era” of computers, it was easy to separate the men from the boys (sometimes called “Real Men” and “Quiche Eaters” in the literature). During this period, the Real Men were the ones that understood computer programming, and the Quiche Eaters were the ones that didn’t. A real computer programmer said things like “DO 10 I=1,10” and “ABEND” (they actually talked in capital letters, you understand), and the rest of the world said things like “computers are too complicated for me” and “I can’t relate to computers — they’re so impersonal”. (A previous work [1] points out that Real Men don’t “relate” to anything, and aren’t afraid of being impersonal.)

But, as usual, times change. We are faced today with a world in which little old ladies can get computerized microwave ovens, 12 year old kids can blow Real Men out of the water playing Asteroids and Pac-Man, and anyone can buy and even understand their very own Personal Computer. The Real Programmer is in danger of becoming extinct, of being replaced by high-school students with TRASH-80s!

There is a clear need to point out the differences between the typical high-school junior Pac-Man player and a Real Programmer.

Understanding these differences will give these kids something to aspire to — a role model, a Father Figure. It will also help employers of Real Programmers to realize why it would be a mistake to replace the Real Programmers on their staff with 12 year old Pac-Man players (at a considerable salary savings).

LANGUAGES

The easiest way to tell a Real Programmer from the crowd is by the programming language he (or she) uses. Real Programmers
use FORTRAN. Quiche Eaters use PASCAL.

Nicklaus Wirth, the designer of PASCAL, was once asked, “How do you pronounce your name?”. He replied “You can either call me by name, pronouncing it ‘Veert’, or call me by value, ‘Worth’.”

One can tell immediately from this comment that Nicklaus Wirth is a Quiche Eater. The only parameter passing mechanism endorsed by Real Programmers is call-by-value-return, as implemented in the IBM/370 FORTRAN G and H compilers. Real programmers don’t need abstract concepts to get their jobs done: they are perfectly happy with a keypunch, a FORTRAN IV compiler, and a beer.

Real Programmers do List Processing in FORTRAN.
Real Programmers do String Manipulation in FORTRAN.
Real Programmers do Accounting (if they do it at all) in FORTRAN.
Real Programmers do Artificial Intelligence programs in FORTRAN.

If you can’t do it in FORTRAN, do it in assembly language. If you can’t do it in assembly language, it isn’t worth doing.

STRUCTURED PROGRAMMING

Computer science academicians have gotten into the “structured programming” rut over the past several years. They claim that programs are more easily understood if the programmer uses some special language constructs and techniques. They don’t all agree on exactly which constructs, of course, and the examples they use to show their particular point of view invariably fit on a single page of some obscure journal or another–clearly not enough of an example to convince anyone.

When I got out of school, I thought I was the best programmer in the world. I could write an unbeatable tic-tac-toe program, use five different computer languages, and create 1000 line programs that WORKED. (Really!) Then I got out into the Real World. My first task in the Real World was to read and understand a 200,000 line FORTRAN program, then speed it up by a factor of two. Any Real Programmer will tell you that all the Structured Coding in the world won’t help you solve a problem like that –it takes actual talent.

Some quick observations on Real Programmers and Structured Programming:

Real Programmers aren’t afraid to use GOTOs. Real Programmers can write five page long DO loops without getting confused.
Real Programmers enjoy Arithmetic IF statements because they make the code more interesting.
Real Programmers write self-modifying code, especially if it saves them 20 nanoseconds in the middle of a tight loop.
Real Programmers don’t need comments: the code is obvious.

Since FORTRAN doesn’t have a structured IF, REPEAT … UNTIL or CASE statement, Real Programmers don’t have to worry about not using them. Besides, they can be simulated when necessary using assigned GOTOs.

Data structures have also gotten a lot of press lately. Abstract
Data Types, Structures, Pointers, Lists, and Strings have become popular in certain circles. Wirth (the above-mentioned Quiche Eater) actually wrote an entire book [2] contending that you could write a program based on data structures, instead of the other way around. As all Real Programmers know, the only useful data structure is the array. Strings, lists, structures,
sets — these are all special cases of arrays and and can be treated that way just as easily without messing up your programing language with all sorts of complications.

The worst thing about fancy data types is that you have to declare them, and Real Programming Languages, as we all know, have implicit typing based on the first letter of the (six character) variable name.

OPERATING SYSTEMS

What kind of operating system is used by a Real Programmer?

CP/M? God forbid — CP/M, after all, is basically a toy operating system. Even little old ladies and grade school students can understand and use CP/M.

Unix is a lot more complicated of course — the typical Unix hacker never can remember what the PRINT command is called this week — but when it gets right down to it, Unix is a glorified video game. People don’t do Serious Work on Unix systems: they send jokes around the world on USENET and write adventure games and research papers.

No, your Real Programmer uses OS/370. A good programmer can find and understand the description of the IJK305I error he just got in his JCL manual. A great programmer can write JCL without referring to the manual at all. A truly outstanding programmer can find bugs buried in a 6 megabyte core dump without using a hex calculator. (I have actually seen this done.)

OS/370 is a truly remarkable operating system. It’s possible to destroy days of work with a single misplaced space, so alertness in the programming staff is encouraged. The best way to approach the system is through a keypunch. Some people claim there is a Time Sharing system that runs on OS/370, but after careful study I have come to the conclusion that they are mistaken.

PROGRAMMING TOOLS

What kind of tools does a Real Programmer use? In theory, a Real Programmer could run his programs by keying them into the front panel of the computer. Back in the days when computers had front panels, this was actually done occasionally. Your typical Real Programmer knew the entire bootstrap loader by memory in hex, and toggled it in whenever it got destroyed by his program. (Back then, memory was memory — it didn’t go away when the power went off. Today, memory either forgets things when you don’t want it to, or remembers things long after they’re better forgotten.) Legend has it that Seymour Cray, inventor of the Cray I supercomputer and most of Control Data’s computers, actually toggled the first operating system for the CDC7600 in on the front panel from memory when it was first powered on. Seymour, needless to say, is a Real Programmer.

One of my favorite Real Programmers was a systems programmer for Texas Instruments. One day, he got a long distance call from a user whose system had crashed in the middle of some important work. Jim was able to repair the damage over the phone, getting the user to toggle in disk I/O instructions at the front panel, repairing system tables in hex, reading register contents back over the phone. The moral of this story: while a Real Programmer usually includes a keypunch and lineprinter
in his toolkit, he can get along with just a front panel and a telephone in emergencies.

In some companies, text editing no longer consists of ten engineers standing in line to use an 029 keypunch. In fact, the building I work in doesn’t contain a single keypunch.

The Real Programmer in this situation has to do his work with a text editor program. Most systems supply several text editors to select from, and the Real Programmer must be careful to pick one that reflects his personal style. Many people believe that the best text editors in the world were written at Xerox Palo Alto Research Center for use on their Alto and Dorado computers [3]. Unfortunately, no Real Programmer would ever use a computer whose operating system is called SmallTalk, and would certainly not talk to the computer with a mouse.

Some of the concepts in these Xerox editors have been incorporated into editors running on more reasonably named operating systems. EMACS and VI are probably the most well known of this class of editors. The problem with these editors is that Real Programmers consider “what you see is what you get” to be just as bad a concept in text editors as it is in women.

No, the Real Programmer wants a “you asked for it, you got it” text editor — complicated, cryptic, powerful, unforgiving, dangerous. TECO, to be precise.

It has been observed that a TECO command sequence more closely resembles transmission line noise than readable text [4].

One of the more entertaining games to play with TECO is to type your name in as a command line and try to guess what it does. Just about any possible typing error while talking with TECO will probably destroy your program, or even worse — introduce subtle and mysterious bugs in a once working subroutine.

For this reason, Real Programmers are reluctant to actually edit a program that is close to working. They find it much easier to just patch the binary object code directly, using a wonderful program called SUPERZAP (or its equivalent on non-IBM machines). This works so well that many working programs on IBM systems bear no relation to the original FORTRAN code.

In many cases, the original source code is no longer available. When it comes time to fix a program like this, no manager would even think of sending anything less than a Real Programmer to do the job — no Quiche Eating structured programmer would even know where to start. This is called “job security”.

Some programming tools NOT used by Real Programmers:

FORTRAN preprocessors like MORTRAN and RATFOR. The Cuisinarts of programming — great for making Quiche. See comments above on structured programming.

Source language debuggers. Real Programmers can read core dumps.

Compilers with array bounds checking. They stifle creativity, destroy most of the interesting uses for EQUIVALENCE, and make it impossible to modify the operating system code with negative subscripts. Worst of all, bounds checking is inefficient.

Source code maintainance systems. A Real Programmer keeps his code locked up in a card file, because it implies that its owner cannot leave his important programs unguarded [5].

THE REAL PROGRAMMER AT WORK

Where does the typical Real Programmer work? What kind of programs are worthy of the efforts of so talented an individual?

You can be sure that no real Programmer would be caught dead writing accounts-receivable programs in COBOL, or sorting mailing lists for People magazine. A Real Programmer wants tasks of earth-shaking importance (literally!):

Real Programmers work for Los Alamos National Laboratory, writing atomic bomb simulations to run on Cray I supercomputers.

Real Programmers work for the National Security Agency, decoding
Russian transmissions.

It was largely due to the efforts of thousands of Real Programmers
working for NASA that our boys got to the moon and back before the cosmonauts.

The computers in the Space Shuttle were programmed by Real Programmers.

Programmers are at work for Boeing designing the operating systems for cruise missiles.

Some of the most awesome Real Programmers of all work at the Jet Propulsion Laboratory in California. Many of them know the entire operating system of the Pioneer and Voyager spacecraft by heart. With a combination of large ground-based FORTRAN programs and small spacecraft-based assembly language programs, they can to do incredible feats of navigation and improvisation, such as hitting ten-kilometer wide windows at Saturn after six years in space, and repairing or bypassing damaged sensor platforms, radios, and batteries. Allegedly, one Real Programmer managed to tuck a pattern-matching program into a few hundred bytes of unused memory in a Voyager spacecraft that searched for, located, and photographed a new moon of Jupiter.

One plan for the upcoming Galileo spacecraft mission is to use a gravity assist trajectory past Mars on the way to Jupiter. This trajectory passes within 80 +/- 3 kilometers of the surface of Mars. Nobody is going to trust a PASCAL program (or PASCAL programmer) for navigation to these tolerances.

As you can tell, many of the world’s Real Programmers work for the U.S. Government, mainly the Defense Department. This is as it should be. Recently, however, a black cloud has formed on the Real Programmer horizon.

It seems that some highly placed Quiche Eaters at the Defense Department decided that all Defense programs should be written in some grand unified language called “ADA” (registered trademark, DoD). For a while, it seemed that ADA was destined to become a language that went against all the precepts of Real Programming — a language with structure, a language with data types, strong typing, and semicolons. In short, a language designed to cripple the creativity of the typical Real Programmer. Fortunately, the language adopted by DoD has enough interesting features to make it approachable: it’s incredibly complex, includes methods for messing with the operating system and rearranging memory, and Edsgar Dijkstra doesn’t like it [6]. (Dijkstra, as I’m sure you know, was the author of “GoTos Considered Harmful” — a landmark work in programming methodology, applauded by Pascal Programmers and Quiche Eaters alike.) Besides, the determined Real Programmer can write FORTRAN programs in any language.

The real programmer might compromise his principles and work on something slightly more trivial than the destruction of life as we know it, providing there’s enough money in it.

There are several Real Programmers building video games at Atari, for example. (But not playing them. A Real Programmer knows how to beat the machine every time: no challange in that.) Everyone working at LucasFilm is a Real Programmer. (It would be crazy to turn down the money of 50 million Star Wars fans.) The proportion of Real Programmers in Computer Graphics is somewhat lower than the norm, mostly because nobody has found a use for Computer Graphics yet. On the other hand, all Computer Graphics is done in FORTRAN, so there are a fair number people doing Graphics in order to avoid having to write COBOL programs.

THE REAL PROGRAMMER AT PLAY

Generally, the Real Programmer plays the same way he works — with computers. He is constantly amazed that his employer actually pays him to do what he would be doing for fun anyway, although he is careful not to express this opinion out loud.

Occasionally, the Real Programmer does step out of the office for a breath of fresh air and a beer or two. Some tips on recognizing real programmers away from the computer room:

At a party, the Real Programmers are the ones in the corner talking about operating system security and how to get around it.

At a football game, the Real Programmer is the one comparing the plays against his simulations printed on 11 by 14 fanfold paper.

At the beach, the Real Programmer is the one drawing flowcharts in the sand.

A Real Programmer goes to a disco to watch the light show.

At a funeral, the Real Programmer is the one saying “Poor George. And he almost had the sort routine working before the coronary.”

In a grocery store, the Real Programmer is the one who insists on running the cans past the laser checkout scanner himself, because he never could trust keypunch operators to get it right the first time.

THE REAL PROGRAMMER’S NATURAL HABITAT

What sort of environment does the Real Programmer function best in? This is an important question for the managers of Real Programmers. Considering the amount of money it costs to keep one on the staff, it’s best to put him (or her) in an environment where he can get his work done.

The typical Real Programmer lives in front of a computer terminal. Surrounding this terminal are:

Listings of all programs the Real Programmer has ever worked on, piled in roughly chronological order on every flat surface in the office.

Some half-dozen or so partly filled cups of cold coffee. Occasionally, there will be cigarette butts floating in the coffee. In some cases, the cups will contain Orange Crush.

Unless he is very good, there will be copies of the OS JCL manual and the Principles of Operation open to some particularly interesting pages.

Taped to the wall is a line-printer Snoopy calender for the year 1969.

Strewn about the floor are several wrappers for peanut butter filled cheese bars (the type that are made stale at the bakery so they can’t get any worse while waiting in the vending machine).

Hiding in the top left-hand drawer of the desk is a stash of double stuff Oreos for special occasions. Underneath the Oreos is a flow-charting template, left there by the previous occupant of the office. (Real Programmers write programs, not documentation. Leave that to the maintainence people.)

The Real Programmer is capable of working 30, 40, even 50 hours at a stretch, under intense pressure. In fact, he prefers it that way. Bad response time doesn’t bother the Real Programmer — it gives him a chance to catch a little sleep between compiles. If there is not enough schedule pressure on the Real Programmer, he tends to make things more challenging by working on some small but interesting part of the problem for the first nine weeks, then finishing the rest in the last week, in two or three 50-hour marathons. This not only inpresses his manager, who was despairing of ever getting the project done on time, but creates a convenient excuse for not doing the documentation.

In general:

No Real Programmer works 9 to 5. (Unless it’s 9 in the evening to 5 in the morning.)

Real Programmers don’t wear neckties.
Real Programmers don’t wear high heeled shoes.
Real Programmers arrive at work in time for lunch. [9]
A Real Programmer might or might not know his wife’s name. He does, however, know the entire ASCII (or EBCDIC) code table.
Real Programmers don’t know how to cook. Grocery stores aren’t often open at 3 a.m., so they survive on Twinkies and coffee.

THE FUTURE
What of the future? It is a matter of some concern to Real Programmers that the latest generation of computer programmers are not being brought up with the same outlook on life as their elders. Many of them have never seen a computer with a front panel. Hardly anyone graduating from school these days can do hex arithmetic without a calculator. College graduates these days are soft — protected from the realities of programming by source level debuggers, text editors that count parentheses, and user friendly operating systems. Worst of all, some of these alleged computer scientists manage to get degrees without ever learning FORTRAN! Are we destined to become an industry of Unix hackers and Pascal programmers?

On the contrary. From my experience, I can only report that the future is bright for Real Programmers everywhere. Neither OS/370 nor FORTRAN show any signs of dying out, despite all the efforts of Pascal programmers the world over. Even more subtle tricks, like adding structured coding constructs to FORTRAN have failed. Oh sure, some computer vendors have come out with FORTRAN 77 compilers, but every one of them has a way of converting itself back into a FORTRAN 66 compiler at the drop of an option card — to compile DO loops like God meant them to be.

Even Unix might not be as bad on Real Programmers as it once was. The latest release of Unix has the potential of an operating system worthy of any Real Programmer. It has two different and subtly incompatible user interfaces, an arcane and complicated terminal driver, virtual memory. If you ignore the fact that it’s structured, even C programming can be appreciated by the Real Programmer: after all, there’s no type checking, variable names are seven (ten? eight?) characters long, and the added bonus of the Pointer data type is thrown in. It’s like having the best parts of FORTRAN and assembly language in one place. (Not to mention some of the more creative uses for #define.)

No, the future isn’t all that bad. Why, in the past few years, the popular press has even commented on the bright new crop of computer nerds and hackers ([7] and [8]) leaving places like Stanford and M.I.T. for the Real World. From all evidence, the spirit of Real Programming lives on in these young men and women. As long as there are ill-defined goals, bizarre bugs, and unrealistic schedules, there will be Real Programmers willing to jump in and Solve The Problem, saving the documentation for later. Long live FORTRAN!

ACKNOWLEGEMENT

I would like to thank Jan E., Dave S., Rich G., Rich E. for their help in characterizing the Real Programmer, Heather B. for the illustration, Kathy E. for putting up with it, and atd!avsdS:mark for the initial inspriration.

REFERENCES

[1] Feirstein, B., Real Men Don’t Eat Quiche, New York, Pocket Books, 1982.

[2] Wirth, N., Algorithms + Datastructures = Programs, Prentice Hall, 1976.

[3] Xerox PARC editors

[4] Finseth, C., Theory and Practice of Text Editors – or – a Cookbook for an EMACS, B.S. Thesis, MIT/LCS/TM-165, Massachusetts Institute of Technology, May 1980.

[5] Weinberg, G., The Psychology of Computer Programming, New York, Van Nostrabd Reinhold, 1971, page 110.

[6] Dijkstra, E., On the GREEN Language Submitted to the DoD, Sigplan notices, Volume 3, Number 10, October 1978.

[7] Rose, Frank, Joy of Hacking, Science 82, Volume 3, Number 9, November 1982, pages 58 – 66.

[8] The Hacker Papers, Psychology Today, August 1980.

[9] Datamation, July, 1983, pp. 263-265.