R
10

Update: I thought my Python script was broken because of a logic error, but it was just a missing colon after an 'if' statement that took me 3 hours to find.

I was convinced my code's structure was wrong and kept rewriting functions, but my friend finally spotted the tiny syntax mistake I'd skimmed over a dozen times, so has anyone else lost a whole evening to a single punctuation mark?
3 comments

Log in to join the discussion

Log In
3 Comments
joseph_black
My worst was a stray comma in a JSON config.
10
adam652
adam6522mo ago
Yeah, my buddy had a real bad one with a semicolon in C. He was pulling his hair out for a full weekend because his loop kept exiting early. Turned out he had typed a semicolon right after the for statement, which basically made it do nothing. The worst part was he'd shown the code to a couple people and they missed it too. It's always the tiny things you stop seeing after staring too long.
5
jamiegreen
jamiegreen15d ago
Bro i read somewhere that these sneaky bugs are actually called "phantom errors" or something like that cause they just vanish when you look too close. I saw a study once that said something like 70% of bugs in production are these tiny stupid mistakes not logic errors. Its crazy how your brain just fills in what it expects to see. My friend had a similar thing with a missing closing bracket in Python where his whole function just ran weird but the indentation looked right. Sometimes you just gotta walk away and come back later.
9