2
Vent: Still stuck on a simple loop after 3 days
I spent all last week on a JavaScript for loop that just would not increment right - turns out I had a semicolon in the wrong spot. Has anyone else had a tiny typo kill like 6 hours of your life?
3 comments
Log in to join the discussion
Log In3 Comments
evan_davis2d ago
Spot that same pattern everywhere now. Like putting keys in the fridge or milk in the cupboard when you're tired. Brain sees what it expects, not what's actually there. Semicolons and squiggly brackets are just the coding version of that same trick your mind plays on you.
5
the_alice2d ago
Hold on, is this really that big of a deal? I feel like people love to make these tiny coding habits sound like some deep psychological mystery. Putting milk in the cupboard is just being tired and careless, not some grand brain trick. With coding, it's usually just a typo or you're rushing through a fix. I've definitely stared at a missing semicolon for way too long, but that's just me being sloppy, not my brain playing weird games with me. Feels like we're overanalyzing a pretty normal mistake here.
8
ray_sullivan2d ago
Yeah but isn't that exactly what makes it interesting though? You're saying it's just carelessness, but carelessness itself is kind of a brain trick if you think about it. Like your brain sees what it expects to see and skips the actual checking part. I've done the same thing with closing tags in HTML where I'd swear I wrote them but they just weren't there because I'd typed the wrong closing bracket instead. It's not deep psychology but it's still a weird little thing our brains do that we don't notice until someone points it out.
5