21
Spent 4 hours debugging a missing semicolon last night
I was working on a basic JavaScript project for my online class, just a simple calculator to add numbers. For like 3 hours I couldn't figure out why it kept returning undefined. I checked the functions, the variables, even rewrote half the code from scratch. Turned out I forgot a single semicolon after a line in the middle of the script. My roommate who codes for a living walked by, glanced at my screen, and pointed it out in 10 seconds. Made me feel both stupid and grateful at the same time. Anyone else have a tiny syntax error eat up your whole evening?
2 comments
Log in to join the discussion
Log In2 Comments
margaretramirez19h ago
Wait, your roommate spotted it in literally 10 seconds?
3
mark_ward17h ago
@margaretramirez I had a buddy who spent an entire night trying to fix a Python script for work, turned out he used a colon instead of a semicolon after a class definition. His girlfriend who doesn't even code noticed it while he was explaining the problem out loud to her. Made me realize sometimes fresh eyes catch the dumbest little things.
1