The irony is that I don't even use the automatic semi-colon insertion feature.
I'm used to add them manually anyway, even in Go, as whenever possible I tend to program in a less idiomatic way (for loops, semi-colons, etc) which allows me to easily port substantial parts of my code from one language to another. For instance, several tools on my github account were initially implemented using Node.js, but I could very quickly port them to D. But I know that this particular inclination makes me belong to an ultra-minority, once again... ;) On Monday, July 31, 2017 at 3:18:09 AM UTC+1, Ian Lance Taylor wrote: > > On Sat, Jul 29, 2017 at 10:36 AM, <ecstati...@gmail.com <javascript:>> > wrote: > > > > ... > > > > But as Gofmt can ALREADY enforces this common coding style, and can be > run > > at any time, including before committing code on the depots, why should > it > > be enforced by the COMPILER too ? > > > > Really, that's the one particular engineer decision I regret. Just one. > But > > that's a big one. Because sometimes, almost ENTIRE teams prefer the > Allman > > style. That's not just a personal affair. All that because maybe 2 or 3 > > languages designers have decided so, moreover to make it easy to > > automatically add the semi-colons. > > > > And it doesn't even work well, we are now force to put a useless comma > after > > the last parameter of a function to be allowed to split the arguments on > > several lines. Please don't insult me by telling there wasn't any other > > possible solution. > > > > For instance, in Javascript, the semi-colon are also optional, but the > > compiler lets you use whatever coding style you want. > > I'll note that there is a lot of discussion on the web about problems > with semicolons in Javascript. When we were discussing the > possibility of a lexical semicolon insertion rule shortly after the Go > open source release, Javascript was considered to be an example of how > not to do it. > > Historically speaking, gofmt came before lexical semicolon insertion. > The existence of gofmt made it possible to seriously consider lexical > semicolon insertion. Implementing it did require, yes, that you must > put a comma after a parameter name in order to split a line and, yes, > that you must put the '{' on the same line as the function definition > or if/for/switch statement, etc. We considered that to be an > acceptable drawback to get a simple rule, knowing that gofmt would > handle all such issues anyhow. > > Ian > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.