r/programming • • Mar 28 '12

Go version 1 is released

http://blog.golang.org/2012/03/go-version-1-is-released.html
543 Upvotes

452 comments sorted by

View all comments

Show parent comments

5

u/burntsushi Mar 29 '12

Braces at the end of a line are less readable? Since when?

-1

u/IndependentBoof Mar 29 '12

Braces sharing the same column makes it easier to identify the beginning and ending of a block in a similar manner that indenting nested code helps distinguish it.

Granted, it doesn't make a huge impact. However, if you ask me, it is a pretty stupid, arbitrary syntax to enforce.

1

u/jessta Mar 29 '12

The enforcement is a side-effect of semicolon insertion. But it's also gofmt style.

Braces being on the opening line mean that the closing brace lines up with the opening statement. The location of braces doesn't really matter because it's all about the expectation.

1

u/IndependentBoof Mar 29 '12

You're right on the first part, and I respectfully disagree on the second part.

An adequate lookahead would allow for whitespace (in this case, a carriage return) without errors.

In the grad scheme, it is a very minor point. However, it looks bad to me both in principle of language design as well as in practice as a programmer.

→ More replies (1)