1
My first Python script crashed because I forgot a colon, but I finally fixed it after staring at the screen for an hour.
4 comments
Log in to join the discussion
Log In4 Comments
the_sean2mo ago
Oh man, that's the worst feeling. I've lost whole afternoons to a single missing bracket or a typo in a variable name. The worst part is when you finally see it, it's so obvious you feel like an idiot. What were you trying to make with the script?
8
the_robin2mo ago
Last week I spent three hours because I wrote "lenght" instead of "length" in a function. @the_sean, I started reading the code out loud to my cat, and that's actually how I caught it. Saying each variable name slowly made the typo jump out. Now I keep a text-to-speech tab open to hear the code back. It sounds silly but it saves me from those tiny mistakes that ruin an afternoon.
4
robinp892mo ago
Ever try rubber duck debugging with a real duck?
0
wendy_henderson218d ago
The cat method works. I read my code out loud to my dog and found a missing parenthesis that way. Now I talk through every line before I run it.
1