r/javascript • • Feb 05 '11

Are Semicolons Necessary in JavaScript?

http://aresemicolonsnecessaryinjavascript.com/
0 Upvotes

66 comments sorted by

View all comments

4

u/wendall911 Feb 05 '11

While it's interesting that syntax can be simplified in javascript, including leaving out curly closures in may places, leaving them in makes sense for many reasons. Mostly, it helps eliminate very hard to debug compiler/minifier errors. Secondly, it helps readability (imo).

The entire premise of the site is flawed as appears to state that the use of semicolons is wrong universally. I think if they want to waste their time on something, there are many more severe problems with most of the javascript code that I see. Semicolons have to be the least important problem I can think of.

1

u/plantian Feb 05 '11

I think actually that they state that it should be left up to the author of the code.

4

u/wendall911 Feb 05 '11

Yes, and also very self congratulatory for having figured out something very basic. I honestly find the authors formatting and coding style quite unreadable. Here is an example https://github.com/isaacs/npm/blob/master/npm.js

1

u/plantian Feb 05 '11

BTW, this is the author of one of the linked blogs but I'm not sure about this website compilation.