A little too quick

It's the early 1980s, and this pilot fish is a grad student in computer science. "I was excited to get a referral from my adviser to a local advertising company that needed help with an accounting system," says fish.

"They had several problems, but the worst one was that the monthly billing run took forever to sort entries before printing invoices."

That's not such a surprise, since it's a homegrown program written in Basic and running on an Apple II.

But it really does take almost forever: The accounting manager tells fish that she starts the sort at closing time, then calls from home several times during the night to ask the janitor whether the sort has finished. Then she drives back to the office to start the bills printing so they're ready to stuff and mail the next day.

Fish copies the code, takes it home and goes to work straightening it out -- and he gets lucky. "Early on, I added a counter to the screen showing how far the sort had progressed," fish says. "It displayed something like 'Record 200 out of 230,000.' This turned out to be a brilliant move. The accountant could now ask the janitor what the monitor said and gauge how long before she had to call back again."

A little more digging and fish discovers the main problem: a very inefficient bubble sort algorithm. Once he rewrites it as a standard bubble sort, the processing time goes way down.

But then he remembers a recent journal article that includes an implementation of quicksort in machine language. He pulls out the magazine and spends a few hours rewriting code, and it runs. Oh, does it run.

"I demonstrated my work to the accountant, showing her that the task that used to take six hours now finished in less than 20 seconds," says fish. "She called in the big boss and started bragging about money well spent.

"That's when I made my big mistake: I told them I had adapted code from a journal. The big boss looked at me and said, 'That's what we're paying you for, to type in stuff from a magazine?'

"I recovered with, 'No, you're paying me to know which magazines to use,' but I don't think it helped much. They never called me back to rewrite the other problem routines.

"I had learned the hard way the first rule in software development: Don't tell everything you know."

Sharky knows you've got a true tale of IT life. So send it to me at sharky@computerworld.com. You'll score a sharp Shark shirt if I use it. Add your comments below, and read some great old tales in the Sharkives.

Now you can post your own stories of IT ridiculousness at Shark Bait. Join today and vent your IT frustrations to people who've been there, done that.

FREE Computerworld Insider Guide: IT Certification Study Tips
Join the discussion
Be the first to comment on this article. Our Commenting Policies