4 ms·
Uh, this might be true for simple programs, but please try and debug complex race conditions with console.logs. It doesn't work very well.
by sz4kerto 11y ago
Uh, this might be true for simple programs, but please try and debug complex race conditions with console.logs. It doesn't work very well.
- msellout 11y agoHow do you use a debugger when your application is distributed across dozens of machines?
- eiriklv 11y agoFor threaded langs that might be true - but in js there are no race conditions in that sense, so console.logs are usually fine for debugging "out-of-order" stuff as well. This is ofc opinionated and based on preference, so YMMV.
- oxymoron 11y agoDebugging complex race conditions isn't necessarily easy using a debugger either, since halting the passage of time has a tendency to make them go away. Why limit your toolbox? Logging statements and debuggers are both useful methodologies for resolving problems, but in the end, it's as the GP says -- your success is going to depend a lot more on your conceptual understanding of the issue and the application than on the debugging technology.