|
I now feel like debuggers are a design smell. I've used them less and less (to the point of not having to use them at all) as I've coded more test-first and designed things to be smaller (lower logic depth, etc.) I mean, all a debugger is, really, is a window into dynamic state, so if you control the, let's just call it what it is, the "rampant dispersion of state" at all times, you end up not needing a debugger (and producing fewer bugs) IMHO. Now I'm sure that kernel-level stuff wasn't designed like this, and probably won't be for some time (I'm hoping Rust changes that story, but not a low-level coder), so debuggers may still be necessary- just making a point that it seems possible to design in such a way that the need for one is drastically reduced, if not eliminated. Or at least, that's how it seems to me in high-level-language-land (things may differ at the assembly and C levels). EDIT: I apologize for OT, probably not the ideal place to start a "are debuggers really necessary if you design code correctly?" discussion, after all this is part 3 of a series, my bad |
Meanwhile I'll rely on the smelly old debugger to dig me out of threading weirdness, memory corruption, resource leakages, other people's bugs, and to provide a window into a combinatorially massive input-dependent state my feeble mind simply can't fathom while writing tests for a tiny corner of a typical system that in aggregate amounts to millions of LOC.