F
11

Changed my mind about using a debugger after a 3 hour hunt for a missing semicolon

I was working on a simple Python script last Tuesday night in my home office, just trying to scrape some weather data. I had a loop that kept breaking and I spent almost 3 hours adding print statements everywhere, trying to see where the logic went wrong. Finally around 11 pm I got frustrated and opened the built in debugger in VS Code, something I always told myself was overkill for beginners. I stepped through the code line by line and found it in under 5 minutes - I had a semicolon at the end of a line where Python doesn't need one in a specific spot, which was throwing off the next line's indentation. The whole time I thought it was a logic error but it was just a silly typo that the debugger caught instantly. Ever since that night I've used the debugger on every project and I feel like it saved me from quitting coding altogether. Has anyone else had a moment where a tool you avoided turned out to be the solution?
2 comments

Log in to join the discussion

Log In
2 Comments
jamie_adams
Oh man, I feel your pain on that one. Those tiny syntax issues that hide for hours are the worst because you convince yourself it has to be something deep when really it's just a stupid typo. I think every programmer has that one tool they avoided and then later realized it would have saved them so much grief.
8
claire872
claire87213d ago
That debugger moment is a total game changer, right? I had almost the exact same thing happen but with a missing colon in a for loop. Took me two hours of print statements before I even thought to step through it. Now I ask myself why I waited so long. It's like the tool was sitting right there, and I was just too stubborn to use it. Did you find yourself kicking yourself for not trying it sooner, or were you more relieved you finally figured it out?
5