|In 1983 I wrote a program for a local weekly magazine that tracked the number of issue sales by each sales location. It would calculate how many of that week's issue each store would get based on recent returns and other history.
The computer was a Canon AS-100 an 8088 that ran CP/M-86. No hard drive, just two 8" floppies. This was either before I knew of dBase II or it wasn't available on this non IBM compatible PC. I wrote the program in a decent dialect of BASIC.
My first issue was that the file copy program (PIP) had a problem copying a large files. It would corrupt the destination file by recopying an earlier section of the file instead of getting fresh data.
The working data file got damaged and it turned out that all their backups were corrupted by PIP.
The work around was to use CopyDisk for a full disk copy until it was patched.
I spent an entire weekend reentering their data so we didn't loose the customer.
The other problem was my own. I wrote database routines, without formal training, in BASIC, that had an obscure error. The customer index would get corrupted, but it took awhile for the corruption to become evident. Eventually a customer entry would not be found.
The fix was to re-index the file. But being a dumb rookie, it took about 12 hours each time. I wrote it with individual floppy disk accesses for each record. Probably using sieve sort. Still didn't find the corruption bug.
To shorten the time, I later split the job so I read from one disk and wrote to a second. This took the time down to about 10 hours. The index corruption bug was still hiding.
In our office we got a machine with a 10 MB hard drive. By this time the PIP issue was fixed and I would take a copy of the corrupted data, copy it to the hard disk and run the disk intensive re-index. Now it only took 2 hours. But I still hadn't found the bug.
Then I got the bright idea of loading all of the key index related fields into a large array in memory.
I rewrote the utility to reindex against every thing in RAM. So much faster, it only took about 20 minutes I think. Had I been more experienced, I would have done this method first rather than beating on the disk IO.
The magazine was sold to a larger publisher and eventually they were going to put the data onto their IBM S/36 or some such. I had to travel farther and no longer had an office key. I still remember sitting in their office on a Saturday morning going over my code one more time and finding the errant comparison that was rarely called. The index never crashed again, and they retired the system about 6 months later.
It was painful, but I learned an awful lot over those 2 years.