Live data from Hacker News

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

github.com

11–20 of 224 posts

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

#12
post #2

Funny, I was just checking out Derby and noticed that their examples follow this style.

Why the hell people are refusing to use semicolons? I don't get it

I've seen a few reasons. The main ones I encounter are: raising the skill requirement to contribute (you have to know JS better than average to never use a semicolon, and do so correctly), aesthetic (fewer characters looks better), and minimalism (don't use what you don't need).

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

#13

Crockford'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?

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.

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

#15

Crockford'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?

Is there any particular reason why you refuse to put in the semicolons in Javascript?

[deleted]

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

#17
post #2

Funny, I was just checking out Derby and noticed that their examples follow this style.

Why the hell people are refusing to use semicolons? I don't get it

Same reason people don't use semi-colons in Python, I imagine.

Besides, I'm not willing to acknowledge any reasons for using semi-colons as significant. And without any significant reasons for it, I may as well not use them. Besides, it makes the code prettier :).

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

#18
post #12

Earlier quoted context omitted.

Why the hell people are refusing to use semicolons? I don't get it

I've seen a few reasons. The main ones I encounter are: raising the skill requirement to contribute (you have to know JS better than average to never use a semicolon, and do so correctly), aesthetic (fewer characters looks better), and minimalism (don't use what you don't need).

Missed the most important: no more errors from missing semi-colons.

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

#19

Crockford'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?

Is there any particular reason why you refuse to put in the semicolons in Javascript?

Because standard-compliant JavaScript implementations don't require them (ECMAScript describes a model of "semicolon insertion" that implementors are supposed to follow).

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

#20
post #12

Earlier quoted context omitted.

Why the hell people are refusing to use semicolons? I don't get it

I've seen a few reasons. The main ones I encounter are: raising the skill requirement to contribute (you have to know JS better than average to never use a semicolon, and do so correctly), aesthetic (fewer characters looks better), and minimalism (don't use what you don't need).

> raising the skill level to contribute

That's insane. Good programmers need not know stupid tiny nits about Javascript (heck, I've worked on a Javascript JIT and I don't really know Javascript). That does not mean that they are not skilled.

> aesthetic

I don't understand how "you must carefully understand how the language parses to understand this line of code" is aesthetically pleasing when compared to unambiguity.

> minimalism

Here, it is needed, at least arguably (by douglascrawford). You could argue that the "optional semicolons" rule is ugly and not minimalistic, and thus the minimalistic approach would be to not use that rule.

Post reply on HN