Live data from Hacker News

Gofumpt: A stricter gofmt

github.com

91–93 of 93 posts

Re: Gofumpt: A stricter gofmt

#91
post #21

Good. Go deserves this. Before gofmt, programmers were allowed to have accents. Teams were allowed to decide their preferred style. Since gofmt, we "avoid bikeshedding" by disallowing the developer from adding any value via formatting. Dozens of languages that are far more sophisticated than Go have adopted this boneheaded approach (typical Go philosophy) in the years since gofmt appeared. It'll be a while before I r…

Ye. This is agile deep down removing the fun from programming with all its toxic processes. Programmers are the worst when it comes to forcing their dogmatic believes on others.

This is actually about removing a number of chores from programming:

- having to worry about confirming to a style guide

- having to review and/or reformat other peoples code to conform to the style guide

- having to learn the style guide

- having to write a style guide

- having to break flow to format your code properly.

In what way is removing a bunch of gross chores intended to make code readable for others, is this about “toxic processes?”

gofmt and friends remove one of the most toxic processes of all: style guides.

Re: Gofumpt: A stricter gofmt

#92
post #64

Earlier quoted context omitted.

I see. That doesn’t seem very sensible in potential-beginning-of-block contexts, in particular in the if case where an implicit empty statement is deduced after the condition.

> That doesn’t seem very sensible in potential-beginning-of-block contexts, in particular in the if case where an implicit empty statement is deduced after the condition. Are you referring to C style if statements where you can elide the braces? In go the braces are mandatory, so I don't think that really applies.

I was referring to the Go documentation linked above:

> One consequence of the semicolon insertion rules is that you cannot put the opening brace of a control structure (if, for, switch, or select) on the next line. If you do, a semicolon will be inserted before the brace, which could cause unwanted effects.

I was assuming that the “unwanted effects” are not simply a syntax error.

Re: Gofumpt: A stricter gofmt

#93
post #21

Good. Go deserves this. Before gofmt, programmers were allowed to have accents. Teams were allowed to decide their preferred style. Since gofmt, we "avoid bikeshedding" by disallowing the developer from adding any value via formatting. Dozens of languages that are far more sophisticated than Go have adopted this boneheaded approach (typical Go philosophy) in the years since gofmt appeared. It'll be a while before I r…

I personally am looking forward to the go tool replaces `go run` etc. for a version that makes additonal whitespace and misalignment into a compiler error!

Not quite the same, but early versions of the gc compiler did run what is now gofmt on your code during compilation.
Post reply on HN