3 ms·
The only time I've found debuggers useful (vs. logs/prints) is when I inherit a pile of spaghetti code and want to see poke around at things. Other than that de
by eikenberry 8y ago
The only time I've found debuggers useful (vs. logs/prints) is when I inherit a pile of spaghetti code and want to see poke around at things. Other than that debuggers are much slower than running the code with a flag that enables the debug logging.
IMO the ability to easily diagnose and debug issues is a feature of the code/application and should be taken into account when writing it. Having to fall back on a debugger means your dealing with something not written with maintenance in mind.
- smt88 8y agoI'm not sure what you're missing about using debuggers, but it's something. Breakpoints and stepping are massive time savers. You can easily replace dozens of runs of a buggy program with a single debugging session. It's genuinely shocking that anyone would argue that debug mode is better.
- z92 8y agoYou also need dozens of stepping and breakpoints with a debugger. A dozen of runs with printf doesn't take more time than a dozen of stepping within a debugger. Reminds me of the classic old debate of command line vs GUI app. GUI might be easier to run, but command line apps are easier to automated, and overall better suited for power users.
- smt88 8y agoSetting a breakpoint takes less time (and shows drastically more of the current state) than printf. Some breakpoints are automated, like breaking on exceptions. There's also the problem that printf affects output for web programs and therefore isn't feasible if you want to eventually see what the output is. It's like you have a sick patient and want to see how they're doing by cutting them in half. X-rays and scans make far more sense.