Live data from Hacker News

Debugging: Indispensable rules for finding even the most elusive problems (2004)

dwheeler.com

151–160 of 238 posts

Re: Debugging: Indispensable rules for finding even the most elusive problems (2004)

#151
I've had trouble keeping the audit trail. It can distract from the flow of debugging, and there can be lots of details to it, many of which end up being irrelevant; i.e. all the blind rabbit holes that were not on the maze path to the bug. Unless you're a consultant who needs to account for the hours, or a teller of engaging debugging war stories, the red herrings and blind alleys are not that useful later.

Re: Debugging: Indispensable rules for finding even the most elusive problems (2004)

#152
If folks want to instill this mindset in their kids, themselves or others I would recommend at least

The Martian by Andy Weir https://en.wikipedia.org/wiki/The_Martian_(Weir_novel)

https://en.wikipedia.org/wiki/Zen_and_the_Art_of_Motorcycle_...

https://en.wikipedia.org/wiki/The_Three-Body_Problem_(novel)

To Engineer Is Human - The Role of Failure in Successful Design By Henry Petroski https://pressbooks.bccampus.ca/engineeringinsociety/front-ma...

https://en.wikipedia.org/wiki/Surely_You%27re_Joking,_Mr._Fe...!

Re: Debugging: Indispensable rules for finding even the most elusive problems (2004)

#153
> #1 Understand the system: Read the manual, read everything in depth, know the fundamentals, know the road map, understand your tools, and look up the details.

Maybe I'm mis-understand but "Read the manual, read everything in depth" sounds like. Oh, I have bug in my code, first read the entire manual of the library I'm using, all 700 pages, then read 7 books on the library details, now that a month or two has passed, go look at the bug.

I'd be curious if there's a single programmer that follows this advice.

Re: Debugging: Indispensable rules for finding even the most elusive problems (2004)

#154
post #153

> #1 Understand the system: Read the manual, read everything in depth, know the fundamentals, know the road map, understand your tools, and look up the details. Maybe I'm mis-understand but "Read the manual, read everything in depth" sounds like. Oh, I have bug in my code, first read the entire manual of the library I'm using, all 700 pages, then read 7 books on the library details, now that a month or two has passed…

great strawman, guy that refuses to read documentation

Re: Debugging: Indispensable rules for finding even the most elusive problems (2004)

#155
post #153

> #1 Understand the system: Read the manual, read everything in depth, know the fundamentals, know the road map, understand your tools, and look up the details. Maybe I'm mis-understand but "Read the manual, read everything in depth" sounds like. Oh, I have bug in my code, first read the entire manual of the library I'm using, all 700 pages, then read 7 books on the library details, now that a month or two has passed…

[deleted]

Re: Debugging: Indispensable rules for finding even the most elusive problems (2004)

#156
post #153

> #1 Understand the system: Read the manual, read everything in depth, know the fundamentals, know the road map, understand your tools, and look up the details. Maybe I'm mis-understand but "Read the manual, read everything in depth" sounds like. Oh, I have bug in my code, first read the entire manual of the library I'm using, all 700 pages, then read 7 books on the library details, now that a month or two has passed…

great strawman, guy that refuses to read documentation

I mean he has a point. Things are incredibly complex now adays, I don't think most people have time to "understand the system."

I would be much more interested in rules that don't start with that... Like "Rules for debugging when you don't have the capacity to fully understand every part of the system."

Bisecting is a great example here. If you are Bisecting, by definition you don't fully understand the system (or you would know which change caused the problem!)

Re: Debugging: Indispensable rules for finding even the most elusive problems (2004)

#157

Wasn't Bryan Cantrill writing a book about debugging? I'd love to read that.

I was! (Along with co-author Dave Pacheco.) And I still have the dream that we'll finish it one day: we had written probably a third of it, but then life intervened in various dimensions. And indeed, as part of our preparation to write our book (which we titled The Joy of Debugging ), we read Wheeler's Debugging . On the one hand, I think it's great to have anything written about debugging, as it's a subject that has…

It's a great talk! I have stolen your "if you smell smoke, find the source" advice and put it in some of my own talks on the subject.

Re: Debugging: Indispensable rules for finding even the most elusive problems (2004)

#158
post #51
post #14

Make sure you're editing the correct file on the correct machine.

That's why you make it break differently first. To see your changes have any effect.

When working on a test that has several asserts, I have adopted the process of adding one final assert, "assert 'TEST DEBUGGED' is False", so that even when I succeed, the test fails -- and I could review to consider if any other tests should be added or adjusted.

Once I'm satisfied with the test, I remove the line.

Re: Debugging: Indispensable rules for finding even the most elusive problems (2004)

#159
I love the "if you didn't fix it, it ain't fixed". It's too easy to convince yourself something is fixed when you haven't fully root-caused it. If you don't understand exactly how the thing your seeing manifested, papering over the cracks will only cause more pain later on.

As someone who has been working on a debugging tool (https://undo.io) for close to two decades now, I totally agree that it's just weird how little attention debugging as a whole gets. I'm somewhat encouraged to see this topic staying near the top of hacker news for as long as it has.

Post reply on HN