News for hackers. Stuff that matters.
Re:Twitter crashes itself with commas by darrenkopp on Tuesday July 17, 2012 @11:56AM (#4256277)
Well, we do know that the guy at Twitter that works on their bootstrap is anti-semicolon, so I would say its likely both.
Re:Twitter crashes itself with commas by mistercow on Tuesday July 17, 2012 @01:08PM (#4256658)
I 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.
Re:Twitter crashes itself with commas by jessedhillon on Tuesday July 17, 2012 @02:24PM (#4257053)
There 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.
Re:Twitter crashes itself with commas by mistercow on Tuesday July 17, 2012 @02:36PM (#4257133)
Right, 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.
Re:Twitter crashes itself with commas by kitsune_ on Tuesday July 17, 2012 @02:41PM (#4257156)
When 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?

Re:Twitter crashes itself with commas by jonknee on Tuesday July 17, 2012 @02:48PM (#4257194)
Purity. 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

Re:Twitter crashes itself with commas by jarin on Tuesday July 17, 2012 @03:56PM (#4257559)
Being 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.

Re:Twitter crashes itself with commas by cristiantincu on Tuesday July 17, 2012 @12:44PM (#4256528)
And we know, as well, that this so-called-argument is an ad hominem attack and a red herring.
Re:Twitter crashes itself with commas by aggronn on Tuesday July 17, 2012 @01:19PM (#4256705)
Its also his opinion and the result of decisions made by people who represent twitter.
Re:Twitter crashes itself with commas by cristiantincu on Tuesday July 17, 2012 @01:23PM (#4256725)
It’s the result of a bug in Opera’s JavaScript interpreter, parsing a minified file. ☺