As I said, I perfecly understand you decision, and the context in which it 
was made.

Anyway, many people here have *strongly* suggested that I must fork the Go 
compiler source code and fix it by myself, so I guess I'll have to do it, 
and find a way to add a pragma which allows to disable the semi-colon 
insertion algorithm, as I actually don't mind at all having to use 
semi-colons, which I do anyway in D and C++...

Le lundi 31 juillet 2017 03:18:09 UTC+1, Ian Lance Taylor a écrit :
>
> 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.

Reply via email to