I'm new to JavaScript, but from what I can tell, the no-semicolons style - is incompatible with existing tools - is incompatible in places with upcoming versions of JavaScript - is harder to refactor, since you might need to add additional tokens to the beginning of lines depending on the previous lines - is confusing to new JavaScript programmers, since + it goes against the recommendations of many of the most popul…
Crockford on Bootstrap's semicolon omission: “insanely stupid code”
191–200 of 224 posts
Re: Crockford on Bootstrap's semicolon omission: “insanely stupid code”
#192For those that agree with leaving semi-colons out of JavaScript that they write for projects, can you explain what the benefit of doing so actually is? Seems like people are valuing aesthetics over producing code that works for 100% of the users/situations.
You will never produce code that works for 100% of users and situations.
Re: Crockford on Bootstrap's semicolon omission: “insanely stupid code”
#193Earlier quoted context omitted.
I found the whole discussion quite sad, the stupid animated GIFs in particular. I became even more sad when I noticed the discussion is being held on GitHub, not Reddit or 4chan. Scrolled through, won't participate. I'd much rather build interesting application.
So, how does it work for you, this missing out on all the (trivial sometimes) fun?
Re: Crockford on Bootstrap's semicolon omission: “insanely stupid code”
#194Regardless of our many diverse opinions, Crockford and Fat are entitled to maintain their own libraries in whatever fashion they desire. The fact that they made the libraries open source means "if you don't like my code or the way it works, here's my code, customize it and leave me alone".
Re: Crockford on Bootstrap's semicolon omission: “insanely stupid code”
#195fwiw, this was patched in bootstrap way before i even encountered this issue - otherwise i wouldn't have closed it outright.
Sorry for the confusion everyone.
You can see the code here in 2.0.3: https://github.com/twitter/bootstrap/blob/2.0.3-wip/js/boots...
I still maintain this is a bug in jsmin, but as others have pointed out - mark and I do our best to make bootstrap flexible with other great tools out there (like jsmin). This includes adding semicolons where necessary or changing minor stylistic things.
Re: Crockford on Bootstrap's semicolon omission: “insanely stupid code”
#196Earlier quoted context omitted.
I wonder when bug tracking sites are going to block reddit referrers (or just prevent them from posting). I've seen this before in comments to PHP bugs and bugzilla bugs.
I disagree. Imho a little infantile humor in places where it "doesn't belong" can be quite refreshing - as long as it remains the exception rather than the rule. People tend to have pretty stiff sticks up their arses in such discussions. Humor, even toilet humor, can remove fear and remind everyone that a debate over a semicolon is not necessarily a life/death situation.
It's like someone yelling and acting up when other people are talking about something important to them, just because that person is bored and doesn't care about the topic.
If you are bored, go somewhere else.
And the net result _every_ single time is that the bug gets locked so no one can post to it. Sometimes they unlock it again after the reddit idiots have left.
Re: Crockford on Bootstrap's semicolon omission: “insanely stupid code”
#197Re: Crockford on Bootstrap's semicolon omission: “insanely stupid code”
#198Earlier quoted context omitted.
Not required doesn't necessarily mean it's a good idea. If they were never needed I'd understand, but sometimes they are. I don't see the point in forcing the developer to make a conscious decision on whether to include a semicolon. Omitting semicolons also means that the correctness of a line of code is determined by the unrelated lines that follow.
While the virtues of semicolon insertion are highly debatable, developers are permitted by the ECMAScript standard to write code that relies on it. A tool like JSMin should be aware of semicolon insertion. ricardobeat put it very well elsewhere in this thread: "It is a bug on JSMin. Minifying should never alter code behaviour."
They just disagree on whether a semicolon gets inserted here.
Re: Crockford on Bootstrap's semicolon omission: “insanely stupid code”
#199Earlier quoted context omitted.
Not required doesn't necessarily mean it's a good idea. If they were never needed I'd understand, but sometimes they are. I don't see the point in forcing the developer to make a conscious decision on whether to include a semicolon. Omitting semicolons also means that the correctness of a line of code is determined by the unrelated lines that follow.
While the virtues of semicolon insertion are highly debatable, developers are permitted by the ECMAScript standard to write code that relies on it. A tool like JSMin should be aware of semicolon insertion. ricardobeat put it very well elsewhere in this thread: "It is a bug on JSMin. Minifying should never alter code behaviour."
Re: Crockford on Bootstrap's semicolon omission: “insanely stupid code”
#200There'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…
"Here is a feature. Don't ever use it. Here is a simple way to do this. This way is dumb, use a 2321 line library instead. There is nothing wrong with X, you just chose one of the 60 wrong ways of using it."
I don't want to think about this kind of stuff, I have enough to worry about as it is. JavaScript is all right as a language of the present, but I really don't want it to be "the future", like many people paint it to be.