L
7

Shoutout to the free Python course from the Boston library

My little weather app project crashed yesterday because I messed up a loop and it ran forever. I spent about three hours staring at the screen before I remembered a video from that library course about using print statements to track values. Stuck one in, saw the problem right away, and felt like a genius. What's your go-to trick when your code just stops working?
3 comments

Log in to join the discussion

Log In
3 Comments
patricia_morgan32
Print statements are my lifeline too. I'll scatter them everywhere to watch how data changes. Sometimes just explaining the problem out loud to my cat helps, even if she doesn't care.
8
lunah86
lunah8611d agoTop Commenter
Exactly this. I had a bug last month where nothing was making sense, so I started printing out every single variable at every step. Caught the issue in under five minutes after I saw that one of my arrays had an extra element that wasn't supposed to be there. The cat comment is real too - I talk to my desk plant when I'm stuck. Actually saying the problem out loud forces me to slow down and think about what's actually happening instead of just staring at the screen worried.
6
dylanh81
dylanh812mo ago
Wait, you spent three hours before trying a print statement? I would have given up after twenty minutes and started over. That course saved you from a long night.
6