4 ms·
> this is why I also promote using a debugger as much as I can as well - there's nothing quite like being able to see _exactly_ what's going on. I don't know,
by ForTheKidz 2y ago
> this is why I also promote using a debugger as much as I can as well - there's nothing quite like being able to see _exactly_ what's going on.
I don't know, the speed of just reading code and maybe inserting some diagnostic messages is hard to beat. It's a pretty bad day if I feel like I need to bust out a debugger—99% of "seeing _exactly_ what's going on" is not going to be relevant and will just distract you.
- davidmurdoch 2y agoDepends on the platform. Using a JS debugger is so easy, yet few devs I know use it.
- MrDarcy 2y agoThe code rarely resembles the runtime state of the system. Debuggers are an incredible shortcut almost all the time.
- ForTheKidz 2y agoI strongly and emphatically disagree on every point (I don't even know what your statement about runtime state and code even means actually, it just seems like a category error, but how do you even write code without being able to reason about runtime state? It just makes no sense.), but I understand there are people who love their debugger and I respect them. Basically the only time I pop open the debugger is when it's otherwise difficult to see runtime behavior—say, a certain condition in a server for which you can't easily access logs. Outside of that it feels like major overhead and distraction from getting the bug fixed. Plus iterating without print statements is a tedious, tedious affair. Don't get me wrong, it's a critical and necessary skill that junior devs often struggle to understand and master. I just think over reliance on the debugger will slow your velocity over time when most bugs have straightforward causes easiest to see by simply reading the code (which you'll have to do anyway with a debugger). I can't tell you how many times I've had to tell devs to put away their tools so we can calmly analyze the code without flipping back and forth between views. The vast majority of the time it's the second pair of eyes that resolves the problem.
- pasc1878 2y agoIf you are troubleshooting it probably is not your code. You probably have not got enough knowledge about the codebase to reason about everything, on a large system noone has.
- ForTheKidz 2y agoThat's a very good point. I never used the debugger so much as writing C++ at google where much of the stack is proprietary and far too large to internalize. C++ is especially hard to reason about, though. The cognitive overhead of "running the compiler" in your brain is just staggering. Even scala doesn't feel that bad. Java code feels like building with LEGO in comparison—super, super easy to read and process.
- MrDarcy 2y agoI suppose you’ve never had to maintain a system heavily reliant on meta-programming techniques.
- SoftTalker 2y agoI use printf (or log messages, or whatever equivalent). Haven't found a need for more.
- xandrius 2y agoSame! I use the debugger when I'm really lost.