2 ms·
> 2. Stabilize, Isolate, and Minimize I feel this section is a bit neglected in terms of clarity and emphasis, it brushes on a lot of advanced details but loos
by tomxor 7y ago
> 2. Stabilize, Isolate, and Minimize
I feel this section is a bit neglected in terms of clarity and emphasis, it brushes on a lot of advanced details but looses sight of the basics important to a novice... Anecdotally but with more than one sample, the most common rudimentary mistake I see is someone attempting to isolate a bug upside-down, i.e poking around in small portions of code that do not comprise the whole system involved in the symptom, without any prior reason to be confident that the portion of code is involved.
In 99% of cases, starting with the whole system involved in reliably reproducing the symptom and then bisecting, or some guided divide and conqueror techniques etc, will get to the interesting parts of code fastest and with confidence that allows focus on elusive bugs. Yes this is not guaranteed to work, e.g notoriously difficult bugs with multiple, disparate factors or even timing issues will evade this technique, but you would still attempt it before resorting to more challenging methods.
Perhaps most teachers miss explicit emphasis of this because it seems so obvious to them, it seems implicit to the word isolate, but if I had to pick one single concept for novices, it would be this one.
- commandlinefan 7y agoIt also highlights the importance of writing isolatable code. The simplest way to do that is to write code that doesn’t use any global variables, but this is something that even experienced developers can’t seem to wrap their heads around in my observation. Even languages like Java that don’t allow global variables end up having them simulated with dozens of “singletons” that are referenced everywhere that do things that make targeted troubleshooting impossible.