Discover more from Register Spill
Laying Siege to a Bug
I love debugging – clear goal, possibly interesting technical surprises, total freedom in approach, and coloring-in-the-lines creativity required. Sometimes when I get assigned a bug I even feel something that could be described as glee. But of course it’s not all love & glee in debugging. Emotions that are quite different can be involved.
“This should be easy.”
“This is disgusting. How did we end up like this? We should burn the whole thing down.”
“This does not make sense. This shouldn’t happen.”
“Look, maybe it’s not a bug? Maybe it should be like this?”
“I won’t ever fix this.”
There’s another one. I ran into it yesterday. It’s this one:
“Okay, if this is how you want to play it, bug, then this is how we’re going to play it.”
It’s when you set out to do something different, when you weren’t assigned a bug ticket but a feature and you went ahead, whistling, and wrote code and then some more and then the bug showed up and you tried to ignore it and put a band-aid on but it wouldn’t disappear and you tried again – bigger band-aid – and it doesn’t work and then you try to fix it somewhat more properly but again no luck and then you try again and again and it just won’t go away.
And then you sit down and have a very personal “I’m gonna need a bigger boat” moment that your wife won’t understand when you talk about it at dinner but then it’s on. You roll up the sleeves – for real and in code. You delete the temporary fixes, you take a breath, and you start to add proper debug tooling, not just print statements but actual tooling that’s not written to be thrown away in 10min. You modify the data structures you work with to contain actually useful debug information, you really read through all of the surrounding code, even the bits which you hadn’t thought were relevant. Then, believe it or not, you also read the documentation the way it should be read and not just snippets here and there in the hopes that you can glance a 1-line remedy to your existential pain. Hell, you might even look up how to use a debugger.
Because at this point you know now that the only way to fix this bug is to learn so much about where it comes from, why it came from there, how and when it behaves the way it does – to shine so much light on it that there’s not a single dark corner left in which it can hide.
That’s where I am this morning with my bug. I wouldn’t say it’s love & glee that I’m experiencing right now, but ask me in a few days.
If you want to make me feel better, subscribe: