7 ms·
For the love of god, please someone tell me what is so offensive about the semicolon. When you replace a thousand of them with commas, nothing has been gained!
by gamache 14y ago
For the love of god, please someone tell me what is so offensive about the semicolon.
When you replace a thousand of them with commas, nothing has been gained!
When you start placing them only at the beginning of certain lines, subject to JS's parsing rules, you are thinking more, not less!
- tomjen3 14y agoIt shouldn't be necessary to write them in the first place. Anyway in this case I guess some automatic code reduction tool has decieded that four characters can be saved by changing it to commas. I doubt it was written that way to begin with.
- shaggyfrog 14y agoIt shouldn't be necessary for me to look both ways before I cross the one-way street in front of my home. But I do.
- georgemcbay 14y ago> It shouldn't be necessary to write them in the first place. I love Go's lack of semicolons but I don't extend that to some foolhardy attempt to write JavaScript without semicolons. In JavaScript, support for proper semicolon-less style is clearly lacking in practice if not in spec (if it weren't lacking this wouldn't be a oft-recurring story, but it is).
- Semiapies 14y agoThis parent comment really shouldn't be down-voted for saying the same thing half the people in this thread said an hour later.
- true_religion 14y agoThey didn't place the commas there by hand. What are you complaining about?
- mistercow 14y agoThis seems very likely not to be a programming style choice but some kind of optimization trick by a JS minifier/compiler. I don't think this has anything to do with the typical semicolon war.
- darrenkopp 14y agoWell, we do know that the guy at Twitter that works on their bootstrap is anti-semicolon, so I would say its likely both.
- cristiantincu 14y agoAnd we know, as well, that this so-called-argument is an ad hominem attack and a red herring.
- aggronn 14y agoIts also his opinion and the result of decisions made by people who represent twitter.
- cristiantincu 14y agoIt’s the result of a bug in Opera’s JavaScript interpreter, parsing a minified file. ☺
- mistercow 14y agoI doubt any remnant of a programmer's semicolon preference would make it through a compiler that performs this sort of optimization. The code is likely going to be transformed into an intermediate form (after applying ASI rules) and then that will be transformed into an optimized output.
- jessedhillon 14y agoThere was a story here a while back about how the Twitter/Bootstrap developer was arguing with Douglas Crockford about whether or not he should have to insert semicolons. The cause of the argument was the fact that the minifier was changing the meaning of the code, IIRC, by preserving semicolon preference.
- hfs 14y agoBecause commas are so much "prettier," all that matters is how the code LOOKS - whether it breaks compatibility or not doesn't matter, as long as it's pretty. So pretty.
- rhizome 14y agoI worked at a company a year ago that was all gung-ho about front-commas for no reason in particular, leading me to believe there's a certain amount of cargo-cult'ing going on here.