3
Spent 4 hours trying to fix a missing semicolon in JavaScript yesterday
I was so sure it was a logic error in my loop, but it was just a stupid semicolon I left out on line 23. Has anyone else burned way too much time on something that simple?
3 comments
Log in to join the discussion
Log In3 Comments
blair_green1mo ago
lol line 23 always knows how to ruin your day. I once spent a full afternoon hunting down a missing closing bracket while my roommate watched me slowly lose my mind. Ended up having to take a break and walk around the block just to clear my head. It's always the tiny stuff that gets you, like the code knows you're rushing and hides the dumbest mistake in plain sight.
3
zara4471mo ago
Has anyone else found that taking a short break actually helps you spot the dumb mistakes faster? @blair_green I feel you on the bracket hunting thing, it's like the code plays hide and seek with your brain. My trick is to read the code out loud line by line or even change the font color temporarily to shake up how my eyes see it. Another thing that saves me is using a linter from the start, it catches those missing semicolons before I even hit save.
2
harperschmidt1mo ago
Wait wait wait, you CHANGE THE FONT COLOR TEMPORARILY? That is actually genius and I'm kicking myself for never thinking of that. I've been doing the read out loud thing too but it makes my cat look at me like I've finally lost it. The font color trick feels like cheating in the best way, I'm definitely trying that next time I'm stuck staring at the same 20 lines for an hour.
2