2 ms·
I don't like the idea of needing the machine to explain to me how my own code actually works. I think it's useful to turn that on its head a little -- I know h
by iainmerrick 8y ago
I don't like the idea of needing the machine to explain to me how my own code actually works.
I think it's useful to turn that on its head a little -- I know how the code should work, but a debugger can show me what it's actually doing, so I can see what's going wrong.
I don't think there's a big difference here between debugging and testing, say. Couldn't you also say that tests explain how your own code works?
I'm afraid of building a habit of making haphazard tweaks until it seems to DTRT in one case.
I like to think of debugging more as a science. It's literally a mix of theory and experiment: the program does something weird, you run some random experiments to gather more data, you come up with a theory that explains the results, you design an experiment to test your theory; a successful theory will then lead you to the correct fix.
A good debugger can help get the most data from your experiments. It's as if the LHC had sensors capable of tracking individual gluons, or the ability to replay a specific collision over and over, or even the ability to set up a desired collision from scratch.