Note that there are some explanatory texts on larger screens.

plurals
  1. POIs it a good habit to run in debug mode?
    text
    copied!<p>I saw a comment on another question (I forget which one) encouraging the asker to avoid testing his/her code in the debug harness unless strictly necessary, citing something to the effect of it acting as a crutch. There's certainly something to be said for developing the skill to deduce the cause of bugs without "direct" evidence. I'm quite a fan of debuggers myself (in fact, I tend to only run <em>without</em> if strictly necessary), but I got to thinking about the relative merits of each approach. </p> <h3>Debugger Pros</h3> <ul> <li>Starting with the obvious, takes less time to zero in on faults, exceptions and crashes</li> <li>Tracing provides a nice alternative to littering your code with commented-out print statements</li> <li>Performance overhead can give you extra wiggle room, i.e. if your program is responsive while debugging, it will almost definitely be so in the wild</li> </ul> <h3>Debugger Cons</h3> <ul> <li>Performance overhead can make iterations slower</li> <li>(Edit) <em>Tunnel Vision</em>: Debugging the symptom can distract you from deducing the cause when the crash occurs long after or far from the defect</li> <li>It may "help" you by initializing variables or otherwise masking bugs, leading to surprises later on</li> <li>Conversely, there's the odd bug that <em>only</em> crops up in a debug configuration; tracking it down may be a waste of effort (though, this is often indicative of a deeper, subtler problem that <em>is</em> worth fixing)</li> </ul> <p>These are general, of course--it varies wildly with language, environment and situation--but what are some other considerations?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload