Live data from Hacker News

Crockford on Bootstrap's semicolon omission: “insanely stupid code”

github.com

191–200 of 224 posts

Re: Crockford on Bootstrap's semicolon omission: “insanely stupid code”

#191

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…

This boggles my mind. Why would someone use a convention that brings in ambiguity, when they could just type a semicolon and avoid all the problems of ambiguity in language parsing?

Re: Crockford on Bootstrap's semicolon omission: “insanely stupid code”

#192
post #177

For 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.

Also: You can write clean bug-free code, but there will still be at least one person on the planet who think your code sucks.

Re: Crockford on Bootstrap's semicolon omission: “insanely stupid code”

#193
post #109

Earlier 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?

I feel bad for anyone who considers this sort of thing "fun"

Re: Crockford on Bootstrap's semicolon omission: “insanely stupid code”

#194
Am I missing something? Aren't Bootstrap and JSMin open source? Instead of focusing on coding philosophies, someone can simply fork JSMin's source and make the appropriate patch, or make a fork of Bootstrap that has JSMin friendly code.

Regardless 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”

#195
Update: Bootstrap fixed their code as Crockford prefers. From fat's comment circa 11 am PDT:

fwiw, 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”

#196
post #174
post #119

Earlier 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.

No, it's just noise.

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”

#198

Earlier 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."

Actually JSMin is aware of semicolon insertion and handles it correctly.

They just disagree on whether a semicolon gets inserted here.

Re: Crockford on Bootstrap's semicolon omission: “insanely stupid code”

#199

Earlier 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."

[deleted]

Re: Crockford on Bootstrap's semicolon omission: “insanely stupid code”

#200
post #33

There'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…

Well, yeah. That's a large part of the reason I don't like the hype around JavaScript.

"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.

Post reply on HN