Ah, I'm so glad that Github allows animations in pull request comments. They really increase the level of discourse!
Crockford on Bootstrap's semicolon omission: “insanely stupid code”
91–100 of 224 posts
Re: Crockford on Bootstrap's semicolon omission: “insanely stupid code”
#92Crockford's stance is annoying purely because it's pedantic and because there are many libraries that embrace this style. We use django_compressor and found bugs from the compressor that uses Jsmin. So I have to use something else to compress them before hand. Are there compressors that use the syntax tree rather than transforming the source?
Re: Crockford on Bootstrap's semicolon omission: “insanely stupid code”
#93Earlier quoted context omitted.
Is there any particular reason why you refuse to put in the semicolons in Javascript?
There's a whole hipster movement going on right now around the idea of omitting semicolons from JavaScript code. I believe CoffeeScript is the culprit. Personally, I agree with Crockford -- it's dumb.
CoffeeScript removes semicolons from CoffeeScript, not JavaScript.
Re: Crockford on Bootstrap's semicolon omission: “insanely stupid code”
#94Frankly this is less about semicolons and more about two people who both have strong opinions and feel that they need to act in a certain way. It doesn't take a lot more effort to rephrase fat's response to be more cordial. "Hi @englishextra, those two lines are valid JavaScript. We try not to use semicolons whey they aren't necessary. See (insert link to the wiki). "JSMin doesn't perform well on bits of JS like this…
Re: Crockford on Bootstrap's semicolon omission: “insanely stupid code”
#95There's something horribly wrong with everything about this. Why is such a smart person as Crockford wasting his time arguing about semicolons in 2012? Why is this at the top of the most popular hacker website? Why are people writing detailed opinions about semicolons in this thread (with surely more to come?) One would hope that at least over time the bike sheds being argued about would start to at least evolve into…
Re: Crockford on Bootstrap's semicolon omission: “insanely stupid code”
#96I think this makes a great negative filter for interviewing actually:
Q: How do you feel about using line-breaks and other obscure JS rules to avoid putting in semi-colons?
A1: That's idiotic (interview progresses)
A2: Great idea (rejected)
That may sound harsh but here's my complaint: working with other programmers means writing code that's easily understood. Syntactic tricks to reduce the character count for a couple of dozen as an artificial barrier to entry shows me that you are far more concerned with mental masturbation and "Javascript elitism" than the needs of the project or your coworkers. Bad culture fit.
User fat ("Jacob") is a perfect example of this.
Crockford could've handled this better but honestly I sympathize with his frustration. Just because something is possible doesn't make it a good idea. You can technically drive a car with no seat belt using nothing but your feet but that doesn't mean you should.
At the end of the day this is a bug in JSMin but how much exactly should one cater for pathological edge cases (which I consider this to be)?
It's all about readability. Sometimes you put parentheses around arithmetic expression to make it clear what's happening, not because it's required. You put a semi-colon after each statement because it's clear.
Re: Crockford on Bootstrap's semicolon omission: “insanely stupid code”
#97Earlier quoted context omitted.
But as of now it's not.
! is already being discussed to be turned into an infix operator in a future version of JavaScript.
Re: Crockford on Bootstrap's semicolon omission: “insanely stupid code”
#98Earlier quoted context omitted.
The 'latest revision of the future specification' you link to is, I think, the set of things the TC39 group has considered and agreed on. The list of things they are currently considering is in the strawman namespace[1] on that wiki. In particular, the "strawman:concurrency" page[2] currently says: The infix “!” operator: An eventual analog of “.“, for making eventual requests look more like immediate requests. [1]:…
[deleted]
I don't think anyone is arguing that x\n!p is a good way to write code. Crockford is pointing out that ASI will not occur when ! is an infix operator.
Re: Crockford on Bootstrap's semicolon omission: “insanely stupid code”
#99Earlier quoted context omitted.
I'm uninterested in any specifics, actually; I'm more interested in how much of the syntax landscape is cut off for future extension, particularly at the expression level. It's one thing to insert semicolons in this case: and another to do so in this kind of case: The former is unlikely to be problematic for future extension, but the latter more so. The general pattern in Algol-derived languages is for all statements…
[deleted]
If you don't understand why I take this approach, you will never understand my position.
Re: Crockford on Bootstrap's semicolon omission: “insanely stupid code”
#100Earlier quoted context omitted.
There's a whole hipster movement going on right now around the idea of omitting semicolons from JavaScript code. I believe CoffeeScript is the culprit. Personally, I agree with Crockford -- it's dumb.
Kind of funny that you say this, since CoffeeScript inserts semicolons. The lack of semicolons is the one major thing in the Github style guide that I think is stupid. It seems silly to avoid using semicolons in Javascript because it actually takes a little bit more effort than just using them.