V
18

PSA: A senior dev showed me how to debug with print statements properly

I was stuck on a Python script for 3 hours at a coworking space last month. A guy in his 60s walked over and saw me adding print statements everywhere. He told me to use the same variable name at each check point so I could see the flow clearly. That one tip saved me so much time, I honestly wished I learned it in my first coding class. Has anyone else had a simple trick from a stranger that just clicked?
2 comments

Log in to join the discussion

Log In
2 Comments
amyh12
amyh125d agoTop Commenter
That trick reminds me how my grandma's kitchen timer fixed spaghetti timing better than any app could.
2
adam_baker
And my dad swore by a burnt-out lightbulb for timing his eggs.
4