301
True crime
(europe.pub)
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.
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).