"In praise of Go" discussion on ycombinator

Jay Byrd JayByrd at rebels.com
Wed Nov 17 00:00:01 PST 2010


On Tue, 16 Nov 2010 23:55:42 -0700, Rainer Deyke wrote:

> On 11/16/2010 22:24, Andrei Alexandrescu wrote:
>> I'm curious what the response to my example will be. So far I got one
>> that doesn't even address it.
> 
> I really don't see the problem with requiring that '{' goes on the same
> line as 'if'.

It *isn't* required. But if you don't put it there, *you get the wrong 
result*. I really don't understand why the problem with Andrei's example 
isn't blatantly obvious to everyone, but I would not want to use any 
product of anyone for whom it isn't.


> It's something you learn once and never forget because it
> is reinforced through constant exposure.  After a day or two, '{' on a
> separate line will just feel wrong and raise an immediate alarm in your
> mind.
> 
> I would even argue that Go's syntax actually makes code /easier/ to read
> and write.  Let's say I see something like this in C/C++/D:
> 
> if(blah())
> {
>   x++;
> }
> 
> This is not my usual style, so I have to stop and think.  It could be
> correct code written in another style, or it could be code that has been
> mangled during editing and now needs to be fixed.  In Go, I /know/ it's
> mangled code, and I'm far less likely to encounter it, so I can find
> mangled code much more easily.  A compiler error would be even better,
> but Go's syntax is already an improvement over C/C++/D.
> 
> There are huge problems with Go that will probably keep me from ever
> using the language.  This isn't one of them.



More information about the Digitalmars-d mailing list