this post was submitted on 04 Dec 2024
64 points (91.0% liked)

Programmer Humor

20039 readers
2222 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

founded 2 years ago
MODERATORS
 
top 7 comments
sorted by: hot top controversial new old
[–] [email protected] 14 points 1 month ago

Tell me you’re a JavaScript StackOverflow copy-pasta noob without telling me you’re a JavaScript StackOverflow copy-pasta noob.

[–] [email protected] 9 points 1 month ago (1 children)

I don't get it? When has this ever fixed a bug? Compiler error sure? But a bug?

[–] Eranziel 2 points 1 month ago (1 children)

Semicolons are technically optional in JS, but there are some rare cases where omitting them can result in different behaviour.

And this is why you should enforce code style, kids. Preferably with an automated tool.

[–] Excigma 1 points 1 month ago* (last edited 1 month ago)

I'm on my phone rn so can't format well, but one such example is:

const thing = require("module")

(async () => { something })()

without a ; at the end of the first line, JavaScript will try to do require("module")() instead

[–] [email protected] 7 points 1 month ago

This type of shit makes me aware that there really are devs that don't care about efficiency and will spend weeks on some really novice shit because their tools and skills are bad.

[–] [email protected] 2 points 1 month ago

print("here");

[–] [email protected] 1 points 1 month ago

Good tip for Pascal.