debugging - Is it a good habit to run in debug mode? -


i saw comment on question (i forget one) encouraging asker avoid testing his/her code in debug harness unless strictly necessary, citing effect of acting crutch. there's said developing skill deduce cause of bugs without "direct" evidence. i'm quite fan of debuggers myself (in fact, tend run without if strictly necessary), got thinking relative merits of each approach.

debugger pros

  • starting obvious, takes less time 0 in on faults, exceptions , crashes
  • tracing provides nice alternative littering code commented-out print statements
  • performance overhead can give wiggle room, i.e. if program responsive while debugging, in wild

debugger cons

  • performance overhead can make iterations slower
  • (edit) tunnel vision: debugging symptom can distract deducing cause when crash occurs long after or far defect
  • it may "help" initializing variables or otherwise masking bugs, leading surprises later on
  • conversely, there's odd bug only crops in debug configuration; tracking down may waste of effort (though, indicative of deeper, subtler problem is worth fixing)

these general, of course--it varies wildly language, environment , situation--but other considerations?

if you're reasonably have bugs deal with, running in debug mode tends make finding them bit faster. if you're @ point think bugs gone, want simulate target environment closely possible, means turning debug mode off.

depending on language, tools, etc., chances pretty decent can that's more or less hybrid of two: generate debugging information, else debug mode. extremely helpful well, can debugging on code after it's generated way customer see (but beware optimization can produce oddities, such changing order of code...)


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -