One year of Go

Nick Sabalausky a at a.a
Fri Nov 12 13:49:08 PST 2010


"Sean Kelly" <sean at invisibleduck.org> wrote in message 
news:ibjq0r$12ki$1 at digitalmars.com...
>I got about halfway through the Go tutorial and was stopped by this:
>
> "You might have noticed that our program has no semicolons. In Go code, 
> the only place you typically see semicolons is separating the clauses of 
> for loops and the like; they are not necessary after every statement. . . 
> This approach makes for clean-looking, semicolon-free code. The one 
> surprise is that it's important to put the opening brace of a construct 
> such as an if statement on the same line as the if; if you don't, there 
> are situations that may not compile or may give the wrong result. The 
> language forces the brace style to some extent."
>
> To me, what they're saying is that their syntax is broken and so it forces 
> a convention upon the users to deal with the issue.  I know this is just a 
> bike shed issue, but seeing something like this in the beginning of the 
> tutorial makes it difficult for me to take them seriously.

Semicolons are normally a bikeshed issue, but if optional-semicolons are 
done in a way that means accidentally putting '{' on the wrong line results 
in silently modified behavior, then that's not a bikeshed, that's just a 
broken language design.




More information about the Digitalmars-d mailing list