News for hackers. Stuff that matters.
Re:Why I Don't Like Golang (2016) by DuskStar on Wednesday June 12, 2019 @08:44PM (#20170857)
Banning go fmt gets rid of one of the best parts of the go ecosystem, and I am horrified that you would do so.

go fmt may not be anyone's favorite code style, but having go fmt is so much better than dealing with everyone else's favorite (incompatible!) styles.

Re:Why I Don't Like Golang (2016) by networkimprov on Thursday June 13, 2019 @01:14AM (#20171986)
There is no spec for go fmt. Its behavior has changed across releases.

It has no switches to disable features.

It destroys many nice single-line constructs, e.g.

    if err != nil { return err }
Much of my code would be painful to read without that one.

On the bright side, it artificially inflates your line count, so you appear more productive!

Re:Why I Don't Like Golang (2016) by DuskStar on Thursday June 13, 2019 @12:24PM (#20176366)
I think we're going to have to disagree there, then - yes that oneliner might reduce your LOC count and help you win at code golf, but it doesn't actually make things more readable and certainly isn't worth breaking from the rest of the community.

The ecosystem-wide consistency of go fmt is its biggest strength. Adding switches to disable features would eliminate that.

Re:Why I Don't Like Golang (2016) by networkimprov on Friday June 14, 2019 @05:03AM (#20181484)
There is a lot more to effective code style than whitespace, and most Go code I've seen doesn't consider that, including the stdlib.

I've put a lot of thought into my style guide, and anyone who hasn't done the same has no useful insight on whether go fmt is a help or a hindrance.

Re:Why I Don't Like Golang (2016) by _bxg1 on Thursday June 13, 2019 @10:51AM (#20175423)
> one of the best parts of the go ecosystem

Is it more powerful in some way than the auto-formatters that exist for nearly every other language?

Re:Why I Don't Like Golang (2016) by DuskStar on Thursday June 13, 2019 @12:20PM (#20176329)
It has one amazing property not shared by any other auto-formatter I'm aware of - it is included with the compiler by default and so is the only formatter in common use. Yes, there are formatters for C++ or Java - but the plural there is not a good thing.