3 ms·
I usually roll my eyes when people declare that they don't use debuggers, but this laid out some very good reasons why stepping through your code to solve your
by hoten 3y ago
I usually roll my eyes when people declare that they don't use debuggers, but this laid out some very good reasons why stepping through your code to solve your bugs comes at an opportunity cost. Namely time, and the chance to fix the problems in your software in a more systemic manner.
I certainly see now why the first instinct to step through gnarly code might not be the best one!
- galangalalgol 3y agoYeah, the majority of why I once used a debugger was to dinf memory aliasing errors or indexing errors in old c++. Now I mostly use rust, or ”modern c++” and I bjust realized I only end up using the debugger when trying to use bindings to older libraries. In the case of rust, with good bindings, that means I'm commenting out code to get it compile, then stepping through to understand some types that aren't visible, or stepping through a runtime error or panic to see what part of the contract is being violated. Occasionally bad bindings or libraries leave me looking for the source of UB or aliasing issues, but that has become rare. So in greenfield rust projects, yeah, t don't think I would need a debugger... That is an odd thought after using gdb directly for a couple decades.
- shortcake27 3y agoTo be fair, most people who don’t use debuggers have no reason other than habit because they didn’t learn to debug using the debugger. I started writing JS/PHP over 20 years ago. Back then I debugged with console/echo/var_dump etc. This stuck with me and is still how I debug today. Every time I see someone use the JS debugger I’m impressed by its utility. Still, I always end up reverting to console logs. It works for me and I can’t find a reason to break the habit.