Articles

Thou Shalt Honour Thy Bugs (or How I Learned to Stop Worrying and Love the bug)


It happened to all of us. On a bad day, a bug report arriving at your inbox can make you cry, scream, or do a table flip. Others can't really stand any kind of bug reports or issues with their code, even on a good day.

If you feel like this is happening to you, perhaps there's something that might help you out. And no, I'm not talking about a pill or a smokeable substance. But just a way of looking at these things differently.

These are a few of the sensations that I felt along my career when facing a bug report, and I'm sure you will be able to empathize with at least one of them:

  • Frustration: "Oh god, plase no, not another one, make it stop..."
  • Frustration 2: "Oh no, not this code again..."
  • Complete denial: "Nah that can't be, it has unit tests, this must be the user's fault."
  • Complete denial 2: "Impossible, that's already fixed, I won't even take a look at it."
  • Complete denial 3: "It works for me. Sorry, you must be lying. Or perhaps you should buy another computer."
  • Rage: "This is ridicoulus, i'm not going to fix THAT!"
  • Acceptance: "Crap, what an idiot, I really f*cked it up this time."
  • Surprise: "WHOA!! BUT A BUG!!!"
  • Fear: "Oh-oh that's a nasty one, I should get this fixed before the whole universe collapses and I have to start looking for a real job."
  • Offended: "Oh really? Are you talking to me? Are you ACTUALLY opening a bug report FOR ME???"
  • Offended 2: "Dude I put that feature out there for free, you didn't even have to ask for it, and you are complaining?"
  • Offended 3: "Oh that's so sad.. but I'm sorry, I don't fix bugs, I only write new features..and only when I want to."
  • Easy escape: "No, that's by design actually..."
  • Lazyness: "Oh come on, just work around it, i'm doing important stuff here -learning esperanto, drinking coffee and reading twitter, etc-.

Ok, first of all, let me say this in my defence: I'm not proud, but I'm human (yeah I know, that's a great excuse to escape from almost any kind of situation, point taken). But also, I think I've learned a few lessons along the way that I'd like to share and perhaps they can help you too.

What I mean is that those sensations are fine, they are completely normal, and totally understandable (as long as we have a nice and decent way to deal with those feelings later on).

Let's face it: we don't like bugs, not at first, at least. Bugs sometimes feel like arrows shot directly to the deepest levels of our proud and ego, and make us feel vulnerable and insecure. And although they just might feel that way for you, they are not that. They are just issues that other people are having when using your code. They like it, they want to continue using it, so they care enough as to report those issues. That's it.

Bugs remind us that we are still humans, that we are not as good as we thought we were in writing code, and that we will f*ck it up from time to time. The only question is when.

Over the years I realized that negative feelings towards bug reports are just a premature, immature, and selfish reaction to a problem that is affecting someone else that is actually using your code.

And knowing this actually helps a lot in finding a way to feel better about these feelings. You might still feel them from time to time, but after a few seconds or minutes (depending on what side of the bed you woke up that day...) you will start looking at things differently.

Bugs makes us better. They give you new problems and situations to think about and usually they serve us well by giving us yet another point of view about the way we write code or design solutions or architectures.

Bugs are there to complement the way you think when writing code. They give you experience.

Bugs always come with a lesson to learn, and they remind us that we can fail and that we still have a long way to go. And that's perfectly fine.

Looking at the positive side of a bug report, you can say "Hey that's cool, there's someone actually using that code!". Wouldn't it be cool to make their experience a bit better? Perhaps that will encourage others to use that code too!

After all.. if your code is not used, what is it good for? And it's inevitable: when people actually use your code, they will report bugs or ask for new improvements or features to serve their own needs.

It's when you don't get these reports that you should be asking yourself if there's someone out there using the code you wrote.

Almost all the code we write is intended to be used. When it's used, people will start to ask for things. That's just the way it works.

So now you know. Keep calm, and keep writing code. Learn to accept and love thy bugs, you will be much happier after that! Best :)