Re:Of parser-fetishists and semi-colons
by tptacek on Monday April 16, 2012 @01:55PM
(#3848493)
Oh for fuck's sake.
[ Parent
| on HN ]
I understand the frustration with this comment, but the clincher for me on the whole anti semi-colon crowd was at this article:
http://www.wordsbyf.at/2011/10/31/i-dont-write-javascript/
He says he doesn't use semicolons, except that it caused issues for those who concatenation scripts so he adds a semicolon to the end of the js file. But, lo! This causes issues for those who use the following pattern:
(function() {
// Le code
})()
This has the potential to cause syntax errors when you execute two anonymous functions after each other. Instead of adding a semi-colon to the end, he "works around" the issue by abusing JavaScript like so: !function() {
// Le code
}()
For fucks sake indeed!