|
In languages whose syntax is derived from C (e.g.: C ← C++ ← Java ← JavaScript), two brace styles are most common: Allman style and 1TBS. In JavaScript, you should use... Pro tip: when someone pays you to write code for them, use whatever style they prefer.
|
|
|
|
|
Yes, but those are both wrong.
|
|
|
|
|
Indeed, symetrical bracing is the only way to go, and for gods sake use tabs instead of 4-spaces - super way to bloat your code files...
|
|
|
|
|
TABs look horrible in Notepad or when typed to the command line or for code I copy to OpenVMS. SPACEs always look right.
|
|
|
|
|
Fair enough if you're a programmer that actually does code in differeent environments...but if you only ever code in VS (and/or use a Notepad replacement like Notepad++) then space-spacing is awful.
TBH - I always code with whitespace showing and I a bit anal about extraneous whitespace - I hate it, it's untidy
|
|
|
|
|
I use SPACEs in VS too and they're great.
Kyudos wrote: I hate it, it's untidy
I lurve whitespace. Yum yum yum.
|
|
|
|
|
I like whitespace, just not unecessary whitespace. Nothing is more irksome than a blank line with whitespace on it...
|
|
|
|
|
Oh, sure, so my editor trims when it loads and saves.
|
|
|
|
|
PIEBALDconsult wrote: but those are both wrong
There is no right or wrong when it comes to opinions.
|
|
|
|
|
You're wrong, in my opinion.
|
|
|
|