Hacker News new | ask | show | jobs
by blacksqr 1406 days ago
Debuggers don't give you enough information when you want more, and too much information when you want less.

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.

1 comments

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...

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.