"In praise of Go" discussion on ycombinator

Rainer Deyke rainerd at eldwood.com
Tue Nov 16 22:55:42 PST 2010


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'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.


-- 
Rainer Deyke - rainerd at eldwood.com


More information about the Digitalmars-d mailing list