11
Showerthought: Debugging with console.log vs actually reading the error message is like night and day
I used to just sprinkle console.log everywhere and hope for clues but after I started actually reading the error stacktrace line by line last month I started fixing bugs in 10 minutes instead of 2 hours, has anyone else made that switch?
3 comments
Log in to join the discussion
Log In3 Comments
ericjackson4d ago
Someone on a coding podcast I was listening to said real devs trace the stack and script kiddies just spam logs. Made me rethink my whole workflow honestly. Once you learn to read where the error actually starts in the call stack it saves so much time.
1
faith_smith4d agoMost Upvoted
I get what they're saying about tracing the stack but calling everyone else a script kiddie for using logs feels kinda gatekeepy lol. Sometimes a quick console log tells you what you need way faster than diving into a call stack.
5
fiona_murray4d ago
That "real devs trace the stack" line sounds like classic internet gatekeeping. But honestly, when you said it saves time, how much faster is it actually compared to just scanning logs?
3