Joy of bugfixing

by jaymz on 7/10/2008

I have spent the past 3 working days bug fixing google checkout code and it has been, to put it mildly a total headfuck. Fixing bugs & code refactoring is of course the mainstay of the working programmer. It’s fun when you’re working through something, you can see progress, but bug fixing is like travelling through London. You feel like you’ve gone miles when really you’ve only made it a couple of stops and it would’ve been quicker to walk.

First off it took the best part of an afternoon to realise that the code I was modifying wasn’t actually being called. Now I’ve never worked with googlecheckout before so you can probably chalk a few hours up to that. For googlecheckout you set the callback code in the account preferences for the store’s account. Why on fucking earth that can’t be passed in the calling code I don’t know. After working that out and seeing that the myriad of tests I’d been doing had actually screwed up a live database the majority of the blood drained from my fingers.

The next two hours where spent looking through log files in a terminal prompt. That was fairly thrilling. At the end of the day I felt like I’d done ten minutes work. Thats sort of the problem with fixing bugs, you can spend hours looking at code, logs and status numbers and when you finally find the error, which is probably something easy, the sheer simplicity of the fix and the few lines of code you need to modify make you feel like you’ve not done much.

So in that way you can kind of compare fixing bugs in source code (especially source code that involves 4 separate processes to actually run) to sex. To get sex you do hours if not days of monotonous, boring work for what boils down to 15 (or maybe 30 if you’ve had a good meal beforehand) minutes of payoff. Obviously this metaphor breaks down rather quickly since fixing source code bugs is a productive pursuit…

Thankfully, on the third day and several hundred tests later (at one point I charged my card over £600 when I got so used to mindlessly clicking through purchase screens) I started making actual progress. In the end I’ve probably changed or moved around about 15 lines of code. I’m now a lot more familiar with code igniter and google checkout but I can’t help but feel the past few days have been slow going and unproductive. Tomorrow I’m bugfixing yet again but now that I have a setup thats working these last few bugs shouldn’t be anywhere near as bad.

One last thing, the documentation for the PHP api of googlecheckout is fucking abysmal.

jaymzcd@googlemail.com

Comments are closed.