4 ms·
Proper logging > debugger. There is absolutely no point single stepping through code, setting up breakpoints, inspecting variables etc, when you could instead
by axod 16y ago
Proper logging > debugger.
There is absolutely no point single stepping through code, setting up breakpoints, inspecting variables etc, when you could instead just insert an extra log statement to see what is going wrong.
If your logging is good, often solving a bug is just a case of looking in a production log and seeing where things went wrong.
The other fact is that the majority of bugs I've seen in my own code have been caused when under load, and it's not feasible to run a debugger on a production system.
I've tried debuggers a fair amount, and they end up being completely useless to me.
- jerf 16y ago"Proper logging > debugger." I assume that statement refers to the amount of noise in question? Sure, print statements are my normal tool, but often I'm working on transforming one data structure into another (compiler-style) and I'm encountering an error "somewhere" down in the middle. After the first few megabytes of logging output get generated, you start to really lose the thread of what's going on. It depends on what you're doing. If you're a CRUD programmer, yeah, I can see how they'd be useless; that's a good deal of my job too and I don't use them then. But when I'm actually doing something interesting and twisty I often need them, if only to set some conditional breakpoints somewhere so I can get into the middle of a complicated process instead of trying to reconstruct the state later. Also they are great for learning libraries by stepping through them.
- maximilianburke 16y agoLogging changes the timing of code making it nearly useless for debugging problems of a concurrent nature. It also falls down when systems cannot afford the overhead of printing all trace data (see: video games), or when embedded platforms have no reasonable TTY to send log data to. A debugger is just a tool and to dismiss a tool as being pointless for all people is ridiculous. Being familiar with all the tools at your disposal as a software developer is never a bad thing.
- axod 16y agoA great reason why you shouldn't use concurrency...
- shortlived 16y agoI would say that logging is fine sometimes, perhaps most of the times but being able to hotswap new code, do a deep inspection of an object (and perhaps some further new evaluation of code that you hadn't previously thought of) comes in very very handy.
- Retric 16y agoNot all developers work on the same sorts of problems in the same way with the same type of time pressure. Debugging helps you work with code you don't understand. So, the longer you work with the same code the less useful it becomes. However, plenty of coders move from project to project patch up a few problems and then move on.