this post was submitted on 14 Aug 2025
296 points (96.2% liked)
Programmer Humor
25730 readers
1236 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 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Interesting, I'm not aware of any way they would affect compile errors. I'd be curious to know more.
I don't have experience with how it affects JavaScript specifically, but independent of programming language, it usually removes the guesswork where the error might be.
The thing is that compilers use fairly static rules for their grammar. So, even if you just typo a comma where there should've been a dot, then its grammar rules don't match anymore and it doesn't really know what to do with your code.
To some degree, it's possible to say certain symbols just cannot appear in a specific place, but especially with a comma, it could be the start of the next element in a list, for example.
Without semicolons, it's likely going to tell you that something's wrong between somewhere before your typo and the next closing brace (
}
). With semicolons, it can generally pinpoint the specific statement where the comma is wrong.This should also make analysis quicker while you're editing the code, as it only has to check one statement (or two, if you're inserting a new line and haven't typed the semicolon yet).