Are you also avoiding debuggers? If so, why? What makes debugging so tedious?
Ask HN: Why are we not using debuggers more?
1–10 of 48 posts
Re: Ask HN: Why are we not using debuggers more?
#2t. Grumpy maintainer
Re: Ask HN: Why are we not using debuggers more?
#3Because developers are deathly allergic to understanding/reading other people's code, and/or do not write them for t. Grumpy maintainer
Re: Ask HN: Why are we not using debuggers more?
#4First, if you can fix most issues with a glance or a brief stare, using a debugger never really feels necessary. It may also feel less like using your own brain and solving a puzzle, and puzzle-solving is a huge part of human psychology (see post title).
Also, the story of the last N years has been the text editor, not the IDE. The IDE and its world is really where the integrated debugging story is a big deal.
But if you are using a text editor--or text editors--integrating debugging is less of a thing. Your time may be better spent with various productivity-focused changes for ergonomics, like studying or changing keyboard shortcuts, installing or writing plugins, setting up your own scaffolding using system tools integration, and so on.
Plus once you know the various shortcuts, it's maybe more fun to use them and zip around adding prints than it is to debug. You also gain practice this way, after all.
But if you moved from text editors to IDEs, IMO you probably brought that same set of practices along.
Anyway, good q, I've thought about this recently as well.
Re: Ask HN: Why are we not using debuggers more?
#5As to why they are a last resort. For me it was just having to learn the debugger and also setting up the debugging environment. For every binary needs to be built with debugging symbols and any libraries you're wanting to step through you have to find the symbols for those too.
Also I think it depends on how low level the language and what kind of program it is.
Some languages/environment don't have debuggers or they aren't very good. I wouldn't say most debuggers that are mature are super great to use either.
Re: Ask HN: Why are we not using debuggers more?
#6I use Jetbrains tools and have an easy time debugging in Java, Python and Javascript. In Java I'd say that you can use unit tests to interactively experiment the same way people do with the CLI in Python with the difference that you get unit tests out of the deal as opposed to having lines scroll away in the console.
I use WebStorm to debug Javascript programs that run in npm but if it is running in the browser I just use the "developer tools" from Firefox, Chrome, Edge or Safari. I think there is some way to attach WebStorm to a running web browser but I've never figured it completely out.
I think the Unix culture is allergic to debugging. It's not that hard to use gdb from the command line and in fact you can do some pretty awesome things with it such as embedded system debugging or debugging the C++ and Java sides of an application at the same time, but for a long time I kept trying graphical front ends for gdb such as ddd that "just don't work".
Re: Ask HN: Why are we not using debuggers more?
#7Learning 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.
Re: Ask HN: Why are we not using debuggers more?
#8The code I write is also a lot more asynchronous nowadays, and debuggers are fairly worthless for async code imo. Pausing on a breakpoint conceals issues with asynchronous timing that good logging will show immediately.
I still believe debuggers should be a part of every developers toolkit, but like anything else, pick the tool for the job and sometimes print statements are just the easiest and fastest. Actually in a lot of cases.
Re: Ask HN: Why are we not using debuggers more?
#9Other than that, debuggers are very superior to print statements and such. You can’t pause a print statement and inspect the objects you didn’t print!
Re: Ask HN: Why are we not using debuggers more?
#10Debuggers 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…
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...