As someone who knows how to use a debugger, I can say for sure that log debugging is fine and often my first approach. If you have a good mental model of the code and the issue, it’s usually just 1-2 logs to solve the problem.
Extremely helpful debugging race conditions
Except when adding the log fixes the race condition.
Except when adding the log fixes the race condition.
(ノ`Д´)ノ彡┻━┻
Yay! Problem solved. 🤓👍
It drives me crazy that half my coworkers do this, including a senior dev. I’ll be on a call trying to help debug something and it makes it so difficult not being able to set a breakpoint
Sure, you can console log an object, but in Python all that gives you is a meaningless class name (or an undecipherable jumble of text)
I console.dir and debugger; and breakpoint all day. You are allowed to mix your strategies.
console for quick and dirty understanding but inspector for more complex fixes.
There are literally university courses which confidently state “Console logging is far more used and better so we won’t talk about a debugger here”!
Like sure, it’s very likely to be used far more, but that doesn’t mean you shouldn’t at least offer some courses or modules about proper use of a debugger…
I used to do debuggers until I started doing embedded and dipped my feet in multithreading (2 different projects). After many hours lost because the debugger straight lied to me about which line of code has been executed, a colleague suggested that I just do a printf like a filthy beginner. And 🤩it worked🤩 and I never went back to the unreliable world of debuggers. Even though now I’m mostly working with single-threaded python scripts.
Can somebody reupload the image at a non-feddit.org host? Feddit is incredibly annoying in that it geoblocks most of Asia.
There you go
It’s like the real life kraken, I’ve never seen it but the name causes dread.
This is what peak performance looks like:
console.log("before dothething"); let r = dothething(); console.log("after dothething"); console.log(r);
Be careful, the actual logging can happen at a later time, and because the log function may take a reference to the value, if you modify r it may show the modified version of r in the logging instead of the original r.
Hey how’d you get your hands on my code