25
Spent 4 hours debugging a missing semicolon in JavaScript
Last Tuesday I was working through a beginner tutorial and my whole script just stopped running. No errors in the console, nothing. I checked my brackets, my variables, even restarted the browser twice. Turns out I forgot a semicolon on the line right after a loop, and the interpreter just silently skipped everything after it. Four hours. Four hours for one tiny character. My roommate suggested I try a linter, and now I run one before I even open the console. Has anyone else had a bug that took way longer than it should have because the error message was basically nonexistent?
1 comments
Log in to join the discussion
Log In1 Comment
the_mary18d ago
Linters are basically therapy for developers. Spent three days once chasing a bug where I'd typed `==` instead of `===` and the console just smiled at me like nothing was wrong. Semicolons, missing brackets, a stray comma in an object, they all just break silently. The worst part is when you finally find it and you feel both stupid and relieved at the same time. Now I run three tools before I even look at the console. It's boring but it saves my sanity.
5