31
Learned to debug with print statements for 3 years before trying a real debugger
Back in 2021 I was working on a Python script that kept crashing and I had like 40 print() calls scattered everywhere to track variables. A senior dev walked by my desk at that co-working space downtown and asked why I wasn't using breakpoints. Felt pretty dumb when I watched him step through the code in 5 minutes and find the bug. Took me another week to get comfortable with pdb but now I can't imagine going back. Does anyone still rely on print statements for complex debugging?
1 comments
Log in to join the discussion
Log In1 Comment
kevin_harris7828d ago
Gotta push back a little on the "40 print() calls" thing. You probably didn't have 40. I mean, if you did, that's its own kind of chaos, right? But yeah, pdb is a game changer once you get it. I still use print() for quick little checks, like when I'm too lazy to fire up the debugger for a simple thing. But for anything with loops or nested logic, breakpoints save me from printing out a whole spreadsheet's worth of variable states. Are you using pdb at all these days or did you move to a fancier IDE debugger?
1