DEV Community

Cover image for The Rules of Debugging

The Rules of Debugging

Jason C. McDonald on February 16, 2019

It's a fact of life: you're going to spend the majority of your coding time debugging. If you've been at this a while, you probably have debugging...
Collapse
 
idanarye profile image
Idan Arye

"QA Engineer walks into a bar. Orders a beer. Orders 0 beers. Orders 999999999 beers. Orders a lizard. Orders -1 beers. Orders a sfdeljknesv." -Bill Sempf

There is actually a second part, which I feel is quite relevant here:

First real customer walks in and asks where the bathroom is. The bar bursts into flames, killing everyone.

Collapse
 
codemouse92 profile image
Jason C. McDonald

Ha! That's now going to be included in all my future retellings of that joke.

Collapse
 
tiguchi profile image
Thomas Werner

Great article! Sometimes turning it off and on again actually breaks things 😁(cue in mysterious music)

A few weeks ago a company I'm working for had a power outage over the weekend. The following Monday my colleagues on site noticed that every single online payment request was failing with permission denied error responses. Every development workstation had the same issue.

Did they all use the wrong access credentials? Was the payment processor temporarily down? No, it worked for me (outside the building).

We dug around, scratched our heads. Then at some point something dawned on me. I asked one colleague on the phone: so what's your time on the desktop? He gasped and realized that the desktop time was off by one minute compared to his phone.

The power outage caused all computers in house to lag behind by one minute. The payment processor requests were signed with the current unix time stamp which got rejected by the payment processor API for being too old (probably to prevent replay attacks).

So... better check your time when your turn it off and on again 😆

Collapse
 
lexlohr profile image
Alex Lohr

I'd like to read more of those bug classifications, especially timing bugs, frankenbugs (that change into other, worse bugs during fixing them, which makes you question the fix) and the insidious heteroptera featurus nonimplementus...

Collapse
 
detunized profile image
Dmitry Yakimenko

A really good article. Thanks, I enjoyed reading it. As someone developing in C++ a lot I know too well what you're talking about. I've seen bugs that defied all the logic and reason. How many time I thought I found a bug in the compiler (and I did a couple of times), but it was just me or my colleague.

When I program in C#, Ruby, Scala or JavaScript I find myself to use the debugger much less. I actually think I've never used the Ruby debugger. I don't even know if there's one.

Collapse
 
mortoray profile image
edA‑qa mort‑ora‑y

I abide by Rule #2, which can unfortunately drive one crazy when you're dealing with an actual library, compiler, or OS bug. I really hate those defects!

They used to be rare, but now, with npm and pip, they seem quite common. :(

Collapse
 
qcgm1978 profile image
Youth

I don't talk to a duck. I downstairs to smoke and then I fix them.

Collapse
 
gijovarghese profile image
Gijo Varghese • Edited

"#10" - my favorite