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.
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
Commas first looks terrible! I get that it allows you to organize/add/remove lines more freely, but I find it much easier to just remember to leave off the last comma. It must take forever to organize it that way.
I mean, any (decent) IDE will yell at you if you leave a trailing comma on the end anyways.
Yeah, I feel weird picking at the author's code though when our code isn't out. I think JavaScript needs to just pick a style guide, I could even sacrifice some readability if it just became consistent although it would be nice to kill two birds(readability and consistency) with one stone(guide). I know the record is almost broken but Python's community follows a style guide and maybe its not perfect but it really helps to have a baseline so people don't go off and waste hours(days, weeks?) sorting out if a single character should be used or not.
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.