News for hackers. Stuff that matters.
Re:Gofmt No Longer Allows Spaces. Tabs Only by MBlume on Thursday June 19, 2014 @01:44AM (#7914637)
Grabbing some Clojure code because it's nearest to hand.

Look here: https://github.com/clojure/clojure/blob/master/src/clj/cloju...

I want the bindings being declared within that let to line up with one another. the first one immediately follows "(let [" so I need the rest to be indented six characters past where the let was originally indented. Six, not N times whatever the tab width happens to be in whichever editor someone's looking at the code in. This is the problem with tabs.

Re:Gofmt No Longer Allows Spaces. Tabs Only by buro9 on Thursday June 19, 2014 @05:06AM (#7915281)
> I want

Which is actually the problem gofmt solves.

The desire to express your individual preference through the way code is formatted is an issue not a feature.

The code may be read, maintained and handled by many other individuals during the life of the code, and gofmt is an attempt to provide an incredibly high degree of consistency in the way that the code is formatted to improve those things.

The Go way is simplicity, readability, maintainability.

Once you accept that consistency in formatting is important and a good thing to strive for, the only question is spaces vs tabs. But spaces is a highly opinionated option as the number of spaces used for indentation has to be uniform, whereas tabs allows for each individual to configure their editing tool to permit a degree of individual preference that does not sacrifice any of the consistency.

Tabs have the advantage, please configure your editor to suit your preference and not the code.

Re:Gofmt No Longer Allows Spaces. Tabs Only by gmjosack on Thursday June 19, 2014 @01:47AM (#7914644)
The way people solve that is tabs for indentation and spaces for alignment. In my opinion this is a terrible compromise as mixing tabs and spaces is sacrilegious.
Re:Gofmt No Longer Allows Spaces. Tabs Only by msutherl on Thursday June 19, 2014 @01:56AM (#7914665)
There is nothing wrong with mixing tabs and spaces. It works great.
Re:Gofmt No Longer Allows Spaces. Tabs Only by _pctq on Thursday June 19, 2014 @03:36AM (#7914864)
Provided everyone use the same tab width :)
Re:Gofmt No Longer Allows Spaces. Tabs Only by dTal on Thursday June 19, 2014 @04:25AM (#7915129)
Nope, works regardless of tabwidth; that's the point. Tabs for indent (these change size with tabwidth), spaces for alignment (these don't change so things stay aligned).
Re:Gofmt No Longer Allows Spaces. Tabs Only by oelmekki on Thursday June 19, 2014 @06:47AM (#7915494)
Oh, you're right. I should have tried it before commenting :)
Re:Gofmt No Longer Allows Spaces. Tabs Only by jsmthrowaway on Thursday June 19, 2014 @02:00AM (#7914678)
Until Python. Then it doesn't.
Re:Gofmt No Longer Allows Spaces. Tabs Only by markrages on Thursday June 19, 2014 @02:50AM (#7914773)
tabs for indent, spaces for alignment works great with Python.
Re:Gofmt No Longer Allows Spaces. Tabs Only by peteretep on Thursday June 19, 2014 @03:12AM (#7914817)
What's a compromise about it? Alignment and indentation are different semantic things, so it makes perfect sense to mix them.