Live data from Hacker News

Gofmt No Longer Allows Spaces. Tabs Only

code.google.com

11–20 of 57 posts

Re: Gofmt No Longer Allows Spaces. Tabs Only

#11
post #2

This is the oldest most persistent argument in programming.

No, Fitz is not advocating tabs over spaces in coding. He is saying gofmt loses a large part of its purpose if it does not enforce a particular style, and the Go devs happen to prefer tabs.

It sounds like he's fine w/ anyone using a tool to format by spaces.

That said, this is quite un-newsworthy.

Re: Gofmt No Longer Allows Spaces. Tabs Only

#13
post #11
post #2

This is the oldest most persistent argument in programming.

No, Fitz is not advocating tabs over spaces in coding. He is saying gofmt loses a large part of its purpose if it does not enforce a particular style, and the Go devs happen to prefer tabs. It sounds like he's fine w/ anyone using a tool to format by spaces. That said, this is quite un-newsworthy.

I'd say it's newsworthy to large Go shops that use spaces with gofmt and now have to change indentation in their repos. This isn't insignificant. Also it requires additional flags for things like blame/diff to ignore whitespace changes.

Re: Gofmt No Longer Allows Spaces. Tabs Only

#14

Who actually uses tabs instead of spaces? I'm genuinely curious--one of the first things pretty much any project I've ever been involved in has been the setting of tabs characters to become spaces, simply because all text editors are retarded in this regard. This is quite strange.

Unsure if trolling or not. It's quite easy to have your editor represent a tab character as "n spaces" - where n is the number of spaces you find pleasing. In fact, I can't recall a serious editor where this isn't the case. What issues have you seen with regards to using tabs?

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

#17

Who actually uses tabs instead of spaces? I'm genuinely curious--one of the first things pretty much any project I've ever been involved in has been the setting of tabs characters to become spaces, simply because all text editors are retarded in this regard. This is quite strange.

I do. Tabs are universal. Three indentations? Three tabs. The same cannot be said for spaces. You have to agree upon the width and make sure everyone sticks to that width.

Now, with tabs, anyone may customize how the width is VIEWED, but the representation on disk is universal.

Re: Gofmt No Longer Allows Spaces. Tabs Only

#18
post #14

Earlier quoted context omitted.

Unsure if trolling or not. It's quite easy to have your editor represent a tab character as "n spaces" - where n is the number of spaces you find pleasing. In fact, I can't recall a serious editor where this isn't the case. What issues have you seen with regards to using tabs?

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 edito…

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

#19
post #2

This is the oldest most persistent argument in programming.

It seems like a pretty silly argument. As long as there's a standard defined, any competent text editor can handle it for you. Go now has a standard - use tabs instead of spaces - and so the debate is over for this language, everybody set your editors accordingly.
Post reply on HN