💡
8
c/coding-for-beginners•the_leethe_lee•3mo ago

Just realized how much time I wasted not using a debugger

I was stuck on a loop in my Python script for like two hours last night, just staring at the code. I finally tried the debugger in VS Code, setting a breakpoint on line 15 where the loop started. Watching the variable values change step by step showed me my counter was resetting wrong. Has anyone else had that 'aha' moment with a debugger, or is there a better tool for beginners?
4 comments

Log in to join the discussion

Log In
4 Comments
cole_baker
cole_baker3mo ago
Saw a tweet from avery_jackson about print statements.
3
kelly385
kelly38519d ago
Print statements have their place, but a proper debugger shows you things print statements just can't catch, like variable state at the exact moment something breaks. That two-hour loop issue wouldve taken ten minutes with a breakpoint and a watch window. You made the right move picking up the debugger early instead of fighting through another year of guesswork like some of us did lol.
3
marywilson
marywilson3mo ago
Print statements were my debugger for years, honestly.
2
avery_jackson
Yeah, the "for years" part hits. I still drop a print in new languages before I even look up their proper debugger. It's like a universal first step, you know? Lets you see the raw flow before you get into fancy tools.
3