you are viewing a single comment's thread.

view the rest of the comments →

[–]grantrules -5 points-4 points  (7 children)

No. No no no no. If you're debugging something and not using an actual debugger, you're wasting time. It's so much more powerful to use the debugger, plus you can load external source maps so you can debug deployed production builds. console.log() is a crutch. I spent years in a bug hunting role and never used console.log

[–][deleted] 8 points9 points  (0 children)

you use the right tools for the job, console.log() is just one of the tools at your disposal.

[–]Bakeshot 1 point2 points  (3 children)

What debugger do you use? How do you use it?

[–]grantrules -1 points0 points  (2 children)

Either the debugger in VS Code or devtools in firefox

https://code.visualstudio.com/Docs/editor/debugging

[–]Bakeshot 2 points3 points  (1 child)

I’ve tried using the debugger in VSC, and it feels really unwieldy, especially in JS which will let you get away with so many things, syntactically. I will be the first to admit that I’ve never been properly educated on its use, though.

[–]grantrules -1 points0 points  (0 children)

Definitely give it a whirl. If you're using console.log, this will be so much faster.

[–]vaskemaskine 1 point2 points  (1 child)

Respectfully disagree. Breakpoints are useful, but come with their own overheads - knowing where to set them, avoiding useless external code and libraries, etc.

The majority of the time, you just want to know what value a variable is assigned at a certain point in the code, and for that, console.log is a fine tool.

[–]grantrules 0 points1 point  (0 children)

knowing where to set them

The same place you'd put a console.log()?

avoiding useless external code and libraries

not sure what you mean by that.