3 ms·
As a rule, never start a new line with an opening brace; it belongs with the previous line. I'm always using the "one true brace style", so that wouldn't
by wazoox 16y ago
As a rule, never start a new line with an opening brace;
it belongs with the previous line.
I'm always using the "one true brace style", so that wouldn't be a problem for me personally; however I feel the pain for people using BSD style. Using a consistent indentation and brace style across all languages you're working with, be it C, Java, Javascript, Perl, PHP is a must, and that Go idiosyncrasy seems really wrong to me; this kind of detail may hamper Go acceptance quite a lot.
- joelthelion 16y agoI'm pretty sure you'd get used to it very fast. I think it's a good idea to enforce one style from the start: it kills all stupid arguments in the egg, and lets people focus on the important stuff.
- uriel 16y agoThis whole topic is another thing where Go is a godsend, gofmt has ended all silly arguments over formatting style.
- wmil 16y agoActually BSD style causes problems in Javascript due to semicolon insertion. http://robertnyman.com/2008/10/16/beware-of-javascript-semicolon-insertion/ http://robertnyman.com/2008/10/16/beware-of-javascript-semic...