this post was submitted on 15 Sep 2023
461 points (84.6% liked)
Programmer Humor
19480 readers
1782 users here now
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
~95% of the JS code you see on the Web has semicolons. Apparently, a lot of programmers think it's worth that extra keystroke to avoid these types of bugs. I agree with them. The difficulty with programming isn't "Arrgh, there are too many keystrokes, my hands are tired!" It's "Arrgh, HTF did this bug get in here?!?"
I don't even bother typing them because I like having eslint do it for me.
They made it a named function, but this is literally how you format anonymous functions in js, a key feature that usually gets called with stuff like an
onclick
oronload
call in the html domain.