5 ms·
my biggest concerns - why people want to _not_ use semicolons? Does it improve load speed may be? or make code more readable or help with something else?
by hippich 15y ago
my biggest concerns - why people want to _not_ use semicolons? Does it improve load speed may be? or make code more readable or help with something else?
- beej71 15y agoYou point is doubly valid when you consider that the code might be run through Closure or Uglify, and all the truly extraneous semicolons will be removed. At that point, load speed is maximized, and the code is unreadable, semicolons or otherwise. Since JS source "feels" more C-like than Python-like to me, I think the semicolons are a good idea.
- einaregilsson 15y agoWell, I think it's more readable without semicolons. Less linenoise. And after reading about exactly how it works I'd rather omit them where I can. The cases where it behaves differently than expected are almost all cases where I think "I would never do that anyway"
- carussell 15y agoWhy are writers afraid of not capitalizing the first word of sentences in English but don't care in Korean? Won't you consider it? Less line noise, you know?
- einaregilsson 15y agoI don't think that's comparable. Maybe it would be if every new English sentence started on a new line ;) The capital letter in English is a strong visual indicator that a new sentence is starting. In code I think the line break does that more than well enough, no need for the ;
- bluesnowmonkey 15y agoReadability. Python, Ruby, and CoffeeScript are more readable for their parsimonious approach to punctuation, aren't they? We like those languages, right?
- burgerbrain 15y agoFor definitions of "we" that exclude "me" perhaps.
- hippich 15y agoI am not in your "we". Also, JS was not designed from start as semicolon-less language. If you prefer semicolon-less JS - use Coffee Script. Otherwise it is very hard to debug such code for someone who do not expect semicolon-less JS code.
- vlisivka 15y agoNo, WE are avoiding Python, Ruby and CoffeScript. If you want good example, say "shell script" instead.