Tuesday, August 02, 2005

 

Atonement

Two years ago, when I first worked on my company's vending-machine product, I was assigned to add some reports. The machine has a small printer inside that can be used to print information on sales, inventory, events, and other data stored in the machine. The reports I implemented have some sections that look something like this:

Count Value
$1 Bills: 23 $23
$5 Bills: 15 $75
$10 Bills: 8 $80
---- -----
Total: 46 $178

See those "----" and "-----" lines used above the sums? Eeearrgh! Those are ugly and amateurish. Every time I see those, I cringe. I'm ashamed. I have some excuses: we were working fourteen-hour days, I wasn't familiar with the codebase, and I always intended to go back and fix them when I had time. But still: eearrgh!

During a demo, one of the vice presidents actually suggested that I help the "junior programmer who did these reports" figure out how to draw nice-looking lines. When I sheepishly told him that I was the one who had done it, he didn't believe me.

Today I had to make some modifications to those reports, so I took the opportunity to finally undo my two-year-old sin. The reports now have honest-to-goodness solid horizontal lines, drawn using Windows GDI calls instead of an ASCII approximation, like this:

  Count Value
$1 Bills: 23 $23
$5 Bills: 15 $75
$10 Bills: 8 $80
 
Total: 46 $178

It made me feel good. As is usual with the really annoying long-term problems like this, it only took about five minutes to fix it.

I wonder which of my current mistakes I'll be fixing in August 2007.


Comments:
Heh, I have a few uglies lying on my conscience. Code I have written and thought "hmm I will do this nicer later" then never quite got around to revisiting. On the other hand I have spent alot of time writing elegant code (some of it out of work hours) only for the company to go out of business and the product disappeared into the ether. One development team I worked with used to write other developers initials next to any "dodgy" code, which was amusing for a short time although I am sure it did lead to deliberately unattractive bad code.
 
Oops missed the main point of my comment, I meant to say it is nice feeling when you can get the opportunity to put right the wrong.
 
Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?