18
Had a day where my code broke everything and I couldn't fix it for 6 hours
I was working on a simple login form for my first real project last Wednesday. Somehow I messed up a single curly brace in my JavaScript and it crashed the whole page, but my editor didn't show any errors. I spent 6 hours staring at the screen, deleting lines one by one, before my friend pointed out the typo in like 2 seconds. Has anyone else had a bug that took forever to find just because of one dumb character?
3 comments
Log in to join the discussion
Log In3 Comments
craig.olivia2d ago
Oh man, I've been there so many times. I once spent like 4 hours trying to figure out why my button wasn't working, and it turned out I put a colon where there should have been a semicolon in the CSS. My coworker walked over and found it in 30 seconds flat. I felt like an absolute clown, staring at the screen like it was gonna confess its crimes to me.
6
blake_kelly192d ago
Yeah that's rough. I once broke a whole website because I forgot a closing bracket.
2
quinn3412d ago
Nah, but that curly brace thing doesn't really make sense. Curly braces in JavaScript aren't usually the kind of thing that silently breaks everything with no error. You probably had a missing bracket that made the curly brace look off. I've done that exact thing where I had one too many or one too few brackets somewhere else in the code, and it looks fine until someone else spots it. Your friend probably found the real problem fast because they saw the whole picture instead of being stuck in the same loop you were in for hours.
4