Hacker News new | ask | show | jobs
by Groxx 5185 days ago
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).
3 comments

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

Sure the "raising the skill level" bit is just trolling. Omitting semi-colons is about removing ambiguity, and making it easier to spot inconsistencies. As a bonus, code looks cleaner.

In this case, the minifier is breaking the code, regardless.

Can you parse this expression without parentheses?

    a && b && c || d || e + f > g && h
The parser sure can. Do you have all the operator precedences memorized, or do you use superfluous parentheses because you're not always sure?

It's true that the semicolon is not needed, and it's true that the minifier is breaking code. It may even be true that Crockford should fix it. But that doesn't change the fact that the omit-the-semicolons position is absurdly immature hipster posturing that serves no engineering purpose.

Do you use parenthesis to denote order of operations in all cases, even when extremely obvious? If not, should we assume your position is absurdly immature hipster posturing that serves no engineering purpose?
I use Lisp, so the answer to your question is yes. I do use parenthesis in all cases.
raising the skill requirement to contribute (you have to know JS better than average to never use a semicolon, and do so correctly)

Great idea! I propose some additional strategies for pruning the contributor pool:

- All numbers in hexadecimal (every idiot knows decimal!)

- No strict equality tests (too easy to reason about & uses extra character!)

- Variable names must consist entirely of unicode ideographs (even my grandmother knows ASCII!)

That should keep the idiots at bay!

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