S
20

Why does nobody talk about using print statements vs proper debugging tools

I used to just spam console.log everywhere in my JavaScript projects, spending like 30 minutes hunting down bugs. Started using VS Code's debugger last week after a buddy showed me breakpoints and it cut my time to 5 minutes. Anyone else still stuck in the old way or made the switch?
3 comments

Log in to join the discussion

Log In
3 Comments
lilykelly
lilykelly2d ago
Wait, you were seriously spending 30 minutes on console.log hunting? That's wild, I feel like everyone just accepts that misery until someone forces them to try breakpoints. I switched years ago and never looked back, debugging is basically painless now.
8
elizabethhayes
Is it really that serious though? I've been coding for like 15 years and still use console.log half the time. Breakpoints are nice and all but sometimes I just want to see a value pop up without setting up a whole debugging session. Feels like people act like it's this huge time sink when really it's like an extra minute or two.
6
eric723
eric7232d ago
The thing with breakpoints is they save your ass on weird state bugs that console.log just can't catch. Like when you're tracking a variable that changes 50 times in a loop, console.log gives you a wall of text but breakpoints let you walk through each step. I do still use console.log for quick checks though, especially on small functions or one-off scripts where setting up the debugger feels like overkill. The balance is knowing when to use each tool instead of treating one like the holy grail.
4