MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/javascript/comments/52fm78/javascript_standard_style_guide/d7jxarg/?context=3
r/javascript • u/kasperpeulen • Sep 12 '16
29 comments sorted by
View all comments
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.
8
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
Never needed a space there for the past 20 years, not gonna start adding one now.
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
function
1 u/Klathmon Sep 13 '16 That's the reasoning. The space vs no-space helps determine definition vs invocation.
1
That's the reasoning. The space vs no-space helps determine definition vs invocation.
6
It's like writing a math function as f (x) instead of f(x). It's just off-putting.
-8
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.
5
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.
-2
Probably the same way the color magenta became the preferred color to someone.
16
u/MoTTs_ Sep 12 '16
When and how did that become a thing?