top | item 11182060

(no title)

deweerdt | 10 years ago

I think that gofmt is particularly innovative, in the sense that it acknowledges that formatting is integral part of the language.

In the sense that a programming language is not only made to be parsed by a computer, but also read back by a human.

discuss

order

nathanielc|10 years ago

Yes, and that the nuances of how things are formatted are really not that important, but rather having a standard which provides a consistent reading experience is the important aspect.

asadjb|10 years ago

I agree completely with this. After fighting over code formatting for so long (often starting those fights myself), I have thankfully come to realize that what format you use almost never matters, only that you use some standardized format.

Coding_Cat|10 years ago

Rust does something similar. It doesn't allow for brace-less clauses and it also bitches and moans at you about 'miss-using' camelCase, snake_case, etc. Which is great because it means that by default all project will follow a similar mark-up.

steveklabnik|10 years ago

We also have 'rustfmt' in development, which goes even further than the built-in lints.

ma2rten|10 years ago

Actually for C there has always been GNU indent, which serves a similar function as gofmt.

aikah|10 years ago

> I think that gofmt is particularly innovative, in the sense that it acknowledges that formatting is integral part of the language.

gofmt is still optional. Python significant white spaces are not.

MereInterest|10 years ago

I thought that the go compiler would throw an error of your code is not in the format produced by gofmt. You don't need to use the tool, but you need to have your code in the same format that the tool would produce.