3 ms·
Yeah. Debugging is getting _way_ less attention than it should. I know some people who _boast_ that they don't use a debugger. To me it feels like a doctor sayi
by cyberax 2y ago
Yeah. Debugging is getting _way_ less attention than it should. I know some people who _boast_ that they don't use a debugger. To me it feels like a doctor saying: "We don't use new-fangled X-Rays here, you should be able to find problems with just a stethoscope".
And good debugging support doesn't need to be some fancy "Minority Report" style 4D animated UI. Just give us good type rendering support, an easy ability to chain breakpoints and set conditional breakpoints, "watch variable" support. Some other things: "where did this value came from?", "watch for value use".
Go is an especially bad example. Its debugger doesn't even allow custom type rendering, so if you have something like a custom generic map container, you can't inspect it at the debug time.
- mrkeen 2y agoFor me, not using a debugger is kind of like not using valgrind. If you stop operating on memory directly, you forget you ever needed valgrind. Likewise, if you write functions instead of methods, then you can just take the problematic input, and evaluate your function on it, and inspect the output - without needing to get the whole program into the right state for stepping through. I kind of gave up on step-through right around the same time I started writing multithreaded code as well.
- cyberax 2y agoDebuggers allow to "look around" the running code. This is really helpful in large systems, where you don't necessarily even know all the components. It's fine when you're working in a nice segregated part of the system, where everything is well-defined. But it's not always the case. Also, single-stepping is a nice mental tool, kinda like rubber-ducking. You single-step and explain to yourself what is going on.
- randomdata 2y agoWell now you have us curious: What programming language treats methods as something other than what is ultimately a function with an additional implied parameter? Whether a parameter is implicit or explicit doesn't really change anything with respect to the state of the program. You need to construct the state either way.
- sroussey 2y agoIndeed, in JS you can call the method with the object explicitly (which allows you to call one objects method with a different object—for better or worse, though usually some meta-programming).