O
13

Update: My code finally worked after a week of errors

Last Thursday, I spent about 4 hours trying to fix a loop in my Python practice project. I kept getting a 'list index out of range' error and couldn't see why. I took a break, came back, and realized I was using the wrong variable name in one spot. That one small fix made the whole thing run. Has anyone else had a simple mistake that took forever to find?
3 comments

Log in to join the discussion

Log In
3 Comments
robinp72
robinp7223h ago
My buddy spent three days debugging a typo in a variable name.
5
wendy_jackson
Oh man, that's the worst. I have to say, spending three days on it feels a bit off though. A simple typo in a variable name should throw a clear error right away in most setups. Maybe it was a more subtle issue, like the variable was defined but the typo meant it always used a default value or something. That kind of logic bug is way trickier to spot than a straight up "not defined" error. Still a brutal way to lose time.
1
anthonymurray
Yeah, but that's the thing. If the typo was in a language without strict variable checking, it might not crash. It just creates a new, empty variable and keeps running with wrong data. That's a nightmare to track down.
1