New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nobody write a space after function name #311

Closed
tkrotoff opened this Issue Oct 29, 2015 · 5 comments

Comments

4 participants
@tkrotoff

tkrotoff commented Oct 29, 2015

You recommend to write function name (arg) { ... } instead of function name(arg) { ... }.

It seems you are the only one among the JavaScript style guides (*) to recommend that:

Consequence, you also recommend to write:

class Foo {
  name (arg) {
    ...
  }
}

instead of

class Foo {
  name(arg) {
    ...
  }
}

None of the popular programming languages out there do that:

And last, statistics show that most people (67%) don't write a space after function in JavaScript.

Related issues: #89, #164, #217

(*) listed on Google first page

@maxogden

This comment has been minimized.

Contributor

maxogden commented Oct 29, 2015

The title of this issue is inaccurate. Currently every user of this module uses spaces after function names. This is a great example of bikeshedding. Please read https://github.com/feross/standard#i-disagree-with-rule-x-can-you-change-it

@feross

This comment has been minimized.

Member

feross commented Oct 30, 2015

@tkrotoff Thanks for sharing your opinion about this issue. It's not open for discussion, though.

@feross feross closed this Oct 30, 2015

@tkrotoff

This comment has been minimized.

tkrotoff commented Oct 30, 2015

The npm name is "standard", the title is "JavaScript Standard Style", the moto is "One Style to Rule Them All" and not something like "Feross JS Style Guide", "Airbnb JS Style Guide", "Google JS Style Guide".

A name like this come with responsibilities.

@feross

This comment has been minimized.

Member

feross commented Oct 30, 2015

Let's be honest: this is an pretty unimportant issue. You might be able to find some minor reasons why your preferred style is better than the other style, but others can come up with reasons why their choice is better than yours, too.

It doesn't matter which choice we pick. Both choices are valid. Neither choice will lead to more bugs or programmer errors. So, we just need to pick something.

What exactly are you proposing? That we change the rule and force 100K+ monthly users to change all their code? Sorry - not happening.

You're free to use another style guide, to extend eslint-config-standard, or even to fork standard if this issue matters that much to you.

@standard standard locked and limited conversation to collaborators Oct 30, 2015

@dcousens

This comment has been minimized.

Member

dcousens commented Oct 31, 2015

Alternatively, just use anonymous arrow functions and you won't even know 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.