3 ms·
Well, we do know that the guy at Twitter that works on their bootstrap is anti-semicolon, so I would say its likely both.
by darrenkopp 14y ago
Well, 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.
- mistercow 14y agoRight, but that was JSMin, which is more of a souped-up find and replace, whereas this comma-replacement strategy is what you'd expect from a much more sophisticated compiler which does static analysis and complex code transformations to squeeze out more than you can achieve by simply compacting white space and deleting comments. That level of modification would be crazy and fragile if you were modifying the original source code, so it's a fair bet that ASI is irrelevant by the time you're looking at the compiler output.
- kitsune_ 14y agoWhen I first had a look at the bootstrap source I was astonished. It seems to be a rather vain thing to do. What does it gain you?
- jonknee 14y agoPurity. Read the issue tracker threads about it, he's militantly against semicolons, even when it's demonstrated to introduce problems with other software (like minifiers). Update: Here's the thread I was thinking of https://github.com/twitter/bootstrap/issues/3057 https://github.com/twitter/bootstrap/issues/3057
- jarin 14y agoBeing anti-semicolon in JavaScript is kind of like being anti-parentheses in Lisp. The automatic semicolon insertion is a "feature" to give some leeway to new/sloppy developers, not a real feature that good developers should use.