4 ms·
Beyond a few simple techniques (printing values, writing and examining logs, practicing the scientific method) and defensive strategies (asserts, writing good t
by kabdib 10y ago
Beyond a few simple techniques (printing values, writing and examining logs, practicing the scientific method) and defensive strategies (asserts, writing good tests, parameter checking, etc.) debugging gets environment-specific pretty quickly. Gronking through a bug in an embedded system is way different from figuring out why your rack of servers has gone dark, though the root cause might be the same.
I've found the best way to learn debugging is to should-surf someone who is good at debugging. For instance, I'd spent six months at Apple before I watched a resident wizard for an hour in the low-level debugger, and what I learned in that hour improved my skills dramatically. Repeat for two other companies: Encounter a tough problem (for you), find a wizard to help out, and pay attention.
I think the sentiment in schools is that sufficiently challenging coursework will force you to learn debugging techniques on your own, as a natural outcome of you writing code :-)