« Radio! From space! | Main | No you haven't. »

June 13, 2005

if ([code seemsGone]) then [screamUntilDuhMoment:@"Shit!"];

There are a variety of ways in which one can start one's day that are acceptable or even favorable. The way I started mine? Not among them. Last week I had nearly finished rewriting the core of one of my applications. The version I've been using has been plagued by memory leaks that have needed plugging. It was also written when I was much less familiar with the frameworks I was using, making it a pain to maintain and nearly unreadable in places. So I sat down last week and rewrote the whole thing, much cleaner, with no memory leaks, and with much better performance than the half-baked original. Other than two very specific bugs, it was ready to go. I'd had enough of trying to figure out why the bugs were occurring and told myself I'd come back to it later. Not being working code, I didn't check it in to my Subversion code repository. This, as I would find today, was a mistake, though it was well inline with my and everyone else's development practices (most people don't check broken code in). I logged into my desktop Mac, went looking for the code... and found nothing. "No big deal," I thought, "I did develop it on my laptop after all." So I put the laptop on an empty corner of my new desk, plugged it in (which is much easier since I set the desk up so the surge strip and APC Uninterruptible Power Supply are on a shelf about a foot below the desktop), and went looking through my Projects folder for the code I knew would be there. Except it wasn't. So I started digging through every folder with any revision of that project, hoping one of them would be right. Nope. Exasperated, I popped open a Spotlight search box and typed in code I was certain was in the version I'd written last week. Never before has "No results found" been such an aggravating message. I wrote that damn code on both computers, but I could find it on neither of them. * * * Now, as cool a technology as Spotlight is, it's not going to save your bacon if you're a complete moron. What I had forgotten in my annoyance was that I'd given that version of the framework an entirely different name so I could distinguish it from the original (oops). And that I had named my variables better, so when I put that Spotlight search in for the code I knew I'd written, I only got back the old stuff with crappy naming practices (oops). My "missing" code had actually stared me in the face when I broadened my search terms, but I ignored it because it wasn't the filename I was expecting (oops). Oops.

Posted by Colin at June 13, 2005 12:25 PM

Trackback Pings

TrackBack URL for this entry:


Post a comment

Remember Me?

(you may use HTML tags for style)