Ask HN: Why are we not using debuggers more?
21–30 of 48 posts
Re: Ask HN: Why are we not using debuggers more?
#22In my case, it's a technical limitation: the code that I write runs on a remote computer, not my laptop. I know that "remote debugging" is a thing, but I would need to talk with our network guys about firewall exceptions to allow me to connect to the Kubernetes pod over port XYZ. That sounds like a hassle, and I'm not sure they'd allow it.
Can you SSH into the remote machine? Visual Studio Code offers quite solid remote development tools through ssh (maybe other means too): https://code.visualstudio.com/docs/remote/remote-overview I would guess that it also supports debugging.
(Thanks also to matthias247, who also suggested this.)
Re: Ask HN: Why are we not using debuggers more?
#23Re: Ask HN: Why are we not using debuggers more?
#24Earlier quoted context omitted.
There is actually a surprising amount of reverse debugging products out there, some are listed here: http://jakob.engbloms.se/archives/1564 Would you be willing to use one of those?
Nice link. Thanks for sharing. I took a quick glance and saw that most of them are for embedded systems. Apart from gdb, do you know anything more friendly for Unix and C/C++ programs?
This may also contain further pointers that I missed: https://softwareengineering.stackexchange.com/questions/1815...
Re: Ask HN: Why are we not using debuggers more?
#25I avoid debuggers because if I can't debug something without them, said something is too complicated for me to understand now, let alone in the future. Moreover, if said something is that complicated, it is almost certainly wrong in several subtle ways. One nice property of asserts is that they keep working even when your attention is elsewhere.
Re: Ask HN: Why are we not using debuggers more?
#26Re: Ask HN: Why are we not using debuggers more?
#27Sometimes you don't know what you don't know.
But yeah, these days I rely on the debugger heavily. Even for Python :)
Re: Ask HN: Why are we not using debuggers more?
#28For me debuggers are the first resort. I learned a long time ago that if you get in the habit of hacking the code to debug it (say adding print statements) you will eventually check in debug-related changes that you shouldn't. Using the debugger means you don't have to hack the source code. I use Jetbrains tools and have an easy time debugging in Java, Python and Javascript. In Java I'd say that you can use unit test…
It’s not just Unix culture that’s allergic to debugging, it’s every chancer and charlatan the world over.
Re: Ask HN: Why are we not using debuggers more?
#29I'll give it another crack because I have just started a new job (new machine, new PHP, new everything) but I have my doubts it will work this time, either.
Setting up debugging for PHP has got to get a whole lot easier and user-friendly, IMO.
Re: Ask HN: Why are we not using debuggers more?
#30When build times are short, spinning up a debugger is overkill compared to adding a couple of debug statements. The 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 anythin…
I often find it a lot faster to set up breakpoints and fire up the debugger than to write debug statements. At least in some IDEs, breakpoints are a single click each, and if you have to restart the application/module/whatever anyway, doing that in a debugger instead of a non-debug run is also just a click. I can then inspect any variable values at the breakpoint instead of having to explicitly include all potentially interesting ones in the debug output.
When I'm trying to figure out a problem in code I'm writing rather than one in production, the debugger is often my first resort.
I'm mostly writing plain old backend code without asynchronicity, though.
Debug output (at a reasonable level) is still useful even outside of asynchronous program flow, of course, because it might give immediate clues for problems encountered in testing or production. If you don't have a good idea of where to look, debug output from several places might also be nicer than having the program stop at lots of breakpoints that turn out to not be useful.