There was little community drama over the lack of semicolons that was causing an issue for a user of twitter’s bootstrap. I think the most pathetic thing here is the newer users who have to be stuck in the middle with broken code because everyone is teaching them different things; not to mention their actual issue(s) being ignored and burned by “community leaders” during their pissing matches.
Here are just a couple of examples that totally cause confusion amongst newcomers:
“Too many errors. (12% scanned).”
Users are also taught the benefits of splitting a project into multiple source files and to concatenate those files, along with any smaller external dependencies into a single file for deployment. This also helps get around the ignored lint check errors mentioned previously. However, with a perfect score on the link check report, loading their application in the browser stops in it’s tracks with the following error:
“TypeError: undefined is not a function”
It ends up that after concatening their project it ended up looking like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
The issue here being
awesome.js did not use semicolons, so once the two files were concatenated, an undefined function invocation was formed between the two imediate executing functions.
The last issue I will mention is the exact issue on twitter’s bootstrap. Once the user took the recommended steps of minifying their project, the removal of whitespace smooshed together statements that were not seperated by semicolons, causing all sorts of wonky errors for the user.
There should not even be a debate whether semicolons are a required syntax or not. I think the simple fact that using semicolons causes no issues and not using them brings out various bugs should make it pretty apparent what we should be doing.