7
Finally figured out why my code kept breaking - it was a missing semicolon after 3 days of staring
I spent last Tuesday night pulling my hair out over a JavaScript loop that kept throwing errors. Turned out I forgot a semicolon after a variable declaration line, something I always skip because I thought it didn't matter in modern JS. My buddy from a coding meetup told me to use a linter called ESLint, and it caught the issue in two seconds. Has anyone else had a tiny syntax mistake like that waste hours of their time?
3 comments
Log in to join the discussion
Log In3 Comments
the_olivia14d ago
Lost an entire Saturday afternoon last month because I put a comma inside a string instead of a period in a filter condition. My linter caught it too, but only after I'd already rewritten half the function.
9
ross.lily13d ago
Laughing because I once spent two hours debugging a Python script only to find out I had a stray semicolon in a string that was supposed to be a colon. It was literally one character off and the whole thing just silently failed. My linter didn't even flag it until I'd already added three extra print statements and rewritten a helper function. Ended up with a horrible mess that looked like spaghetti code. Still works though, so I guess I'll never touch it again.
6
riverh4914d ago
Blame @the_olivia for working on a Saturday instead of the comma that caused the bug.
2