Re:Ask HN: Why are we not using debuggers more?
by pentab on Thursday August 18, 2022 @02:45PM
(#32513382)
What kind of information would help you to debug? And what kind of information is "too much"?
Personally, I think "too much" is when you get a large table of all variables and their values; it is quite hard to locate the one you care about...
Re:Ask HN: Why are we not using debuggers more?
by suprjami on Thursday August 18, 2022 @05:11PM
(#32514953)
Inspect all global variables in gdb. You get every variable defined in a linked library, pages and pages and pages of output with your own program's global's stuffed somewhere in the middle. Useless.
Learning and effectively using a debugger can require as much cognitive load as programming itself.
Given that, using a debugger takes you out of your programming mindset and into debugger mindset. Using prints, asserts, etc. keeps you in programming mindset, so you can find and fix the problem and get back to coding without the need for cognitive gearshifting.