DCSIMG
The Bug and You - Doron's .NET Space

The Bug and You

One thing I learned over the years is that programming can tell you a lot about yourself, and even improve you as a person. Can you handle intense pressure? Can you make the impossible possible by finding creative solutions?

Imagine the bug of your nightmares creeping into your code days before the deadline. This bug, like all really annoying bugs, is happening randomly, caused by no apparent reason, and is impossible to solve. Think segmentation-faults in your university C++ project 10 hours before it's due (and of course, at first it looks like the error happens only you're looking away from the screen or while eating a banana.)

Now there's a character-building moment. Will you crash under the pressure and give up? Or will you step up, be a man (or a woman, I'm no sexist) and face the thunder? Here is some advice for those who choose the latter, inspired by The Pragmatic Programmer, a must-read book for any programmer.

  1. Take a deep breath. Go drink something (I mean coffee or water. I find that alcohol is bad for bug-solving).
  2. The bug is not random - you or one of your teammates got their names on it -  and it is not impossible to solve. Tell this to yourself.
  3. Remind yourself the last time you thought a bug was random/impossible. You felt rather stupid at the end, didn't you?
  4. Tell a teammate, or anybody else (yes, even your mother) about the bug. Sometimes you'll realize the solution as you speak (and the authors of The Pragmatic Programmer suggest that if you don't have anyone to talk to right now, you can try a rubber duck).
  5. Google is your friend.
  6. Get some sleep. Sometimes things seem so much clearer at the morning. With a fresh mind you'll get better results.
  7. Don't be shy; Ask for help. Your teammates, online forums, or all at once. You can post about it in your blog if you have one.
  8. Think about this as a riddle you're trying to solve. Write down the options. Rule out things. Focus on others.

Believe me, these tips work. And trust me when I say, once this ultra-difficult bug is solved, you will feel either really stupid (because you forgot to assign that variable) or really proud (because you managed to solve that deadlock in a creative way). Either way - you'll end up a better person for it. What doesn't kill you...

I actually wrote this post for myself, as I am now facing one of these massive-looking bugs. Every time that happens, I need to remind myself of all of this, so I decided to write it down at last, and also share it with you. I will now follow advice number 6, go to sleep, and probably dream some bug-related dreams.

And for you, Mr.Almighty Bug: I will beat you, you slimy ***. It's just a matter of time before your head will be in the ground, together with the rest them.

Published Monday, February 12, 2007 5:56 PM by dorony
תגים:

Comments

# Why I Like My Job

Recently I've been reflecting on my life's choices. Just a reflective kind of mood, I guess.

Friday, June 27, 2008 9:14 PM by Doron's .NET Space

Leave a Comment

(required) 
(required) 
(optional)
(required) 

Enter the numbers above: