3
Spent 3 days debugging a function that was missing a single colon
Last Tuesday I was working on this little Python script to sort my music files. Everything looked right in the code, I checked my loops and conditionals over and over. But the thing just kept crashing with a syntax error. After 3 days of frustration I finally noticed I forgot a colon after my else statement. It was right there on line 47. That little missing colon made me lose a whole weekend. I felt so stupid but also relieved it wasn't something bigger. Has anyone else spent way too long on a tiny typo like that?
2 comments
Log in to join the discussion
Log In2 Comments
paul25129d ago
48 hours on a missing semicolon in JavaScript once.
2
scott.shane27d ago
and honestly that's the kind of thing that makes you question everything you know about coding. i've been there too man, staring at a page of code for hours and then you find out it's just one stupid little character. the trick i picked up after the third or fourth time this happened is to always check the error console first thing before you even look at the code. like literally open it up and just scan for any red text, because most of the time the browser will actually tell you exactly where the missing semicolon is if you just pay attention. people overlook that step way too often and end up wasting time. another thing that helps is to just copy your code into a linter if you're really stuck, it'll catch those tiny punctuation problems in seconds. once you've been burned by a semicolon a few times you kinda develop a sixth sense for where they might be hiding though.
6