3 ms·
For 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 y
by mrkeen 2y ago
For 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).