Live data from Hacker News

Ask HN: Why are we not using debuggers more?

news.ycombinator.com

11–20 of 48 posts

Re: Ask HN: Why are we not using debuggers more?

#12
post #9

I love using the debugger but now I want one where I can rewind the program a few steps if I want to. The use case I have is to go back and forth trying out different combinations of variables on a section of code. Even if I could manually set a flag to store the program state at certain portions so I can return there, that would work great. Other than that, debuggers are very superior to print statements and such. Y…

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?

Re: Ask HN: Why are we not using debuggers more?

#13
My team regularly uses debuggers developing our C/C++ codebase. Often they are just one part of the workflow, combined with logging and visualization tools (to look at complex data structures as graphs). Debuggers often help track down where something bad happened to narrow down the search through logs and traces, and to figure out what part of a giant data structure to focus on. Most people I interact with work similarly : a combination of debugger, printing, logging/tracing, and viz. We tend to use debuggers less in other languages for various reasons (either poor debugging tools, or failure modes that are easier to understand via other methods).

Re: Ask HN: Why are we not using debuggers more?

#14
In 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.

Re: Ask HN: Why are we not using debuggers more?

#15
post #5

I'm getting more into using debuggers lately. They can really help they just take time to learn. As 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 th…

Yes, it is sad that setting up debugging is so tedious.

Could you give some examples or languages/environments with "bad" debuggers?

Re: Ask HN: Why are we not using debuggers more?

#16

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

you could check if the debugger somehow can run over SSH. That would alleviate the need for opening more ports.

Re: Ask HN: Why are we not using debuggers more?

#17

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

Re: Ask HN: Why are we not using debuggers more?

#18
One doesn’t often reach for a tool that isn’t convenient to reach for, even though that tool may be the best available for the task at hand.

If you force yourself to use the debugger more, you will in the process both familiarise yourself with it and iron out any configuration kinks. Learn those keyboard shortcuts, figure out how to make it autoconnect and break on exceptions, find out how to evaluate expressions on the fly, …

You + That tool = maybe goodness. Maybe not.

Re: Ask HN: Why are we not using debuggers more?

#19
post #12
post #9

I love using the debugger but now I want one where I can rewind the program a few steps if I want to. The use case I have is to go back and forth trying out different combinations of variables on a section of code. Even if I could manually set a flag to store the program state at certain portions so I can return there, that would work great. Other than that, debuggers are very superior to print statements and such. Y…

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?

Re: Ask HN: Why are we not using debuggers more?

#20
I 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.

Post reply on HN