Bad variable names and then awful “temporary” log lines… I feel attacked this morning. ;)
It blows my mind how often i see people using temp logs for debugging when breakpoints exist
When the issue is only seen after hours of runtime, logging is more practical.
Or when the overhead of the debugger causes the issue to never happen
Idk… I had problems in the past with weird bugs where the breakpoints do not match the right line although using sourcemaps and all that so sometimes you end up doing stuff like this. Or if you want to know how many times something executes without well having to “continue” on each breakpoint or similar.
This is a professional debug techique, what are you talking about? But I rather use ‘Hii’ with various (but not ascending) amounts of i’s.
Sometimes I use various swears. Depends on how long I’ve had to debug. Also depends on whose work I’m debugging and whether they’re in earshot. Usually it’s just my own sketchy code though.
Been there, done that
I’ve used a regex to add a console log to the top of every method with the method name before.
the things you do when you’re desperate.
var num =0 ... console.log("Here " + num++) ... console.log("Here " + num++)
console.count()