9
Spent 5 hours tracking down a missing semicolon in JavaScript
I was building a simple to-do list app for my first real project. Everything looked fine but the page kept giving me a blank white screen. After 4 hours of checking loops and functions, I finally realized I forgot a semicolon after a line declaring an array. My buddy laughed and said that happens to everyone, but it drove me nuts. Has anyone else spent way too long on something this stupid?
2 comments
Log in to join the discussion
Log In2 Comments
margaret_singh19d ago
Oh man, that's rough. I've definitely been there. What I'm wondering is how long you were looking at the actual line with the missing semicolon before you spotted it? Was it sitting there in plain sight the whole time, or did you actually have to scroll past a bunch of other code to find it? I always feel like those are the worst bugs, when the thing causing the whole problem was hiding in a spot you already checked three times.
4
wesleyburns9d ago
Ngl I read somewhere that devs spend like 30% of their time actually writing code and the rest just hunting down dumb stuff like this. There was this study about how our brains basically fill in missing punctuation when we read our own code, so you literally look right at it and see it as correct. That blank white screen is the worst too, at least an error message gives you something to work with.
3