30
A junior dev asked me why I use console.log instead of a debugger
He said it looked sloppy but watching his face when I showed him how fast I can find bugs in 3 minutes by just logging variables in a loop changed his mind, anyone else still stubbornly sticking with the old ways?
3 comments
Log in to join the discussion
Log In3 Comments
paige_martin1mo ago
People overlook the social side of it. When you're pair programming or screen sharing, walking through a console log is way easier for the other person to follow than some breakpoint that jumps all over the place. Makes the debugging feel like a team sport instead of a magic show.
7
julia6221mo ago
7
gavinhunt1mo ago
Did you ever try using the browser's built in debugger instead of console logs? I was in the same boat till someone showed me how to set breakpoints in the source tab. It takes a minute to get used to but once you do, you can step through each line of code and see variables change in real time. Feels like having x-ray vision compared to guessing from a console log.
6