Jul 16, 2008 16:24
It's never fun to dig through other people's code because it's like going through their dirty laundry (both figuratively and literally in a figurative sense). You only do it because, well, if it's broken or it kind of works but it sucks and it's pissing you off. Well, an internal tool written by a long-departed employee finally pissed me off enough last time that I decided to figure out why it'd take 10 seconds (on a good day...could be 30 on a bad day) to do something that should take 1 second.
What I discovered can be explained in the following metaphor. Let's say that you need to copy some information from a phone book to find a store. A regular human would find the address of the store he's interested, copies it down, and goes off, right? Would you consider copying the entire phone book first, then find the store in your copious notes? Sounds dumb right? Well, guess what's the tool doing? Oh yeah...you guessed it, the dumb thing.
Now it runs in 1 second.
work,
rant