3 ms·
> According to my opinion, a programming language should let a developer use his or her style. A heavy influence on the programmer’s style is okay, but a fanact
by jayflux 9y ago
> According to my opinion, a programming language should let a developer use his or her style. A heavy influence on the programmer’s style is okay, but a fanactic, religious-like enforcement is inacceptable.
As someone who has wasted many hours debating which JavaScript style guide to follow I disagree with this. Go have quite frankly put to bed any debates or arguments over "curly brace on same line or below" by setting a style and having it policed by the compiler. When working in a team it's good to have an official style guide that's enforced, in the long run this is a good thing.
I don't think this was done because Go's developers are opinionated, I think they looked at other languages and seen the mess that can happen when you don't set a style guide and thought "we're not doing that"
- Graziano_M 9y agoAlso his one example: > For example placing an opening curly bracket on a new line causes the compiler to emit a syntax error. That's actually part of the syntax, not the style. The compiler adds an implicit semicolon at the end of every line, and if there is one before the block of a switch, if, for, etc, then it looks like it's missing (and the next line's curly braces is just a new block.
- pawadu 9y agoCould not agree more! The author has obviously not tried to maintain a project where each contributor has his own coding style.