Go versus Brand X

Gregory Ewing greg.ewing at canterbury.ac.nz
Sun Nov 22 08:26:02 CET 2009


> On Nov 21, 11:20 am, John Roth <johnro... at gmail.com> wrote:
 >
>>Go is simply C with most (but not all) of the warts
>>removed and some more modern features added.

Syntax-wise, I find myself disappointed that they didn't
do as good a job of removing the warts as they could
have.

For example, there are good reasons for putting types
after variable names, but just swapping them around doesn't
quite work. C's "int x" reads well because it mimics similar
constructs in English which qualify a noun with another
noun, e.g. "President Obama". If you say "Obama President",
it doesn't sound right. You need some extra punctuation
to make it meaningful: "Obama, President".

Similarly, I think just a little bit more punctuation
is needed to make name-first declarations readable. For
my money, it's hard to beat the Wirth style:

   func foo(x: int; y: char): float

However, Go's designers seem to favour using the absolute
minimum number of characters they can get away with.

Although if they *really* wanted that, they would have
dropped most of the semicolons and used indentation-based
block structure instead of curly braces. I would have
forgiven them several other sins if they'd done that. :-)

-- 
Greg



More information about the Python-list mailing list