r/javascript • • Sep 12 '16

JavaScript Standard Style Guide

https://github.com/feross/standard
0 Upvotes

29 comments sorted by

View all comments

16

u/MoTTs_ Sep 12 '16

Space after function name

function name (arg) {  
  // ...  
}

When and how did that become a thing?

8

u/notTheAggressorHere Sep 12 '16

Adding a space after the name feels yucky to me. Will not do.

4

u/scunliffe Sep 13 '16

Never needed a space there for the past 20 years, not gonna start adding one now.

4

u/azium Sep 12 '16

Not sure how to answer this question, but I've been doing this myself for quite some time. It helps me quickly scan what is a function definition vs a function call.

But then again nowadays I never use the function keyword, so shrug

1

u/Klathmon Sep 13 '16

That's the reasoning. The space vs no-space helps determine definition vs invocation.

6

u/_HlTLER_ Stackoverflow searcher Sep 12 '16

It's like writing a math function as f (x) instead of f(x). It's just off-putting.

-8

u/mikrosystheme [κ] Sep 12 '16

The world is going to end because of that, isn't it?

5

u/MoTTs_ Sep 12 '16

Did I say that?

Actually I just genuinely want to know how that became a thing.

-2

u/mikrosystheme [κ] Sep 12 '16

Probably the same way the color magenta became the preferred color to someone.