Live data from Hacker News

Proposed JavaScript Standard Style

github.com

21–30 of 116 posts

Re: Proposed JavaScript Standard Style

#21
post #14

Earlier quoted context omitted.

That is a really bizarre choice since I think "no semicolons" is the less popular position by far.

Let's just say that coupling this preference with the name "standard" is an extremely contentious decision (search the github issues).

https://github.com/Flet/semistandard

Of course the solution is to create a separate "standard."

Re: Proposed JavaScript Standard Style

#22
In case it's not obvious, this is definitely not a "standard" of any kind. It was named "JavaScript Standard Style" as a joke, and has since become moderately popular.

I disagree with some of the rules, but there's clearly merit to having one opinionated, zero-configuration linter-enforced style.

Re: Proposed JavaScript Standard Style

#23

I started skimming the rules and was like "this all seems fine" and then noticed "no semicolons". YOU'LL PRY THEM FROM MY COLD, DEAD HANDS FIRST

That's how I felt about spaces instead of tabs.

I actually got into a Twitter argument with Brendan Eich over it - he more or less won with the note that the tab key in most web editors switches input.

Re: Proposed JavaScript Standard Style

#24
I've been lucky enough to avoid having to deal with a style guide in a long time. The general idea is sound, but such a guide is always accompanied by hours-long meetings of senior developers hurling their egos at each other over an issue like semicolon usage. Such a waste of everyone's time.

Re: Proposed JavaScript Standard Style

#25
post #17

"Standard" for whom? This is just some guy enshrining his preferences.

This is addressed in the README But this isn't a real web standard! Of course it's not! The style laid out here is not affiliated with any official web standards groups, which is why this repo is called feross/standard and not ECMA/standard. The word "standard" has more meanings than just "web standard" :-) For example: This module helps hold our code to a high standard of quality. This module ensures that new contri…

I don't claim a project has to be an "official" Web standard to be a standard, but I'm seeing a hard time how this one is a standard in any meaningful sense.

Re: Proposed JavaScript Standard Style

#27

I started skimming the rules and was like "this all seems fine" and then noticed "no semicolons". YOU'LL PRY THEM FROM MY COLD, DEAD HANDS FIRST

Maybe if I was using Python or Ruby. But JS? REALLY ugly practice. Multiple blank lines not allowed? I usually go with two to segment heavily procedural code. The most appalling thing by far though is spaces instead of tabs... what's wrong with this guy?

Re: Proposed JavaScript Standard Style

#29
post #9

I started skimming the rules and was like "this all seems fine" and then noticed "no semicolons". YOU'LL PRY THEM FROM MY COLD, DEAD HANDS FIRST

I hope they enjoy their subtle and extremely hard to find errors.

Could you cite some examples? It seems that using the rest of the conventions might eliminate many, if not all, of them.

Re: Proposed JavaScript Standard Style

#30
Regarding the "no semicolon" stuff, is there actually any way to write this type of formatting

    list.map(func1)
        .filter(func2)
        .map(func3)
        .reduce(func4);
in JavaScript? As far as I know, the semicolon rules would automatically terminate the statement after map(func1).

EDIT: Ah, thanks – the things I read never mentioned JS doing lookahead during ASI. This makes it a lot nicer, tbh.

Post reply on HN