F
6

The week I spent 6 days debugging a missing semicolon in JavaScript and wanted to throw my laptop out the window

I literally cried on day 4 when my console.log still showed nothing and my husband asked if the code was 'angry' - has anyone else ever wasted that much time on a single stupid character?
3 comments

Log in to join the discussion

Log In
3 Comments
nathan100
nathan1001mo ago
Throw your laptop on the bed and walk outside for a bit. I've been there more times than I want to admit. A missing semicolon in JavaScript is the worst because the error message is usually useless. I started using a linter like ESLint right after a similar 5 day adventure and it caught that stuff before I even saved the file. Also try reading your code out loud line by line once you're past the crying stage, it forces your brain to actually see each character. Your husband sounds like a good guy for trying to help, mine just brings me tea and backs away slowly.
8
baker.holly
Try reading your code backwards - it breaks your brain's pattern recognition and makes typos jump out.
6
pat_stone
pat_stone1mo ago
I used to think I was pretty good at catching my own typos, but that one time I spent two whole days hunting down a missing '}' in a config file changed my mind real quick. Sometimes you just have to walk away and come back with fresh eyes.
5