OT but I think GitHub should show tabs as 4 columns. I find Go code is hard to read with all this whitespace.
Or better, we should save source code files replacing tabs with spaces. That's the best practice that makes everybody happy.
Facebook Go Libraries
21–30 of 98 posts
Re: Facebook Go Libraries
#22Earlier quoted context omitted.
Sorry, changed "spaces" to "columns".
... and the only reason for it to be four columns is that you personally find it hard to read, or do you have another, more compelling argument against using 8 column tabs?
Re: Facebook Go Libraries
#23Earlier quoted context omitted.
Or better, we should save source code files replacing tabs with spaces. That's the best practice that makes everybody happy.
Go uses tabs. That's the law. It's in the documentation. Groups of spaces and tabs are semantically different. Tabs mean indentation. Spaces mean spaces.
Re: Facebook Go Libraries
#24Looks more like Naitik Shah's open-source libraries.
These were all developed on the Parse team. Naitik is a huge contributor :) I believe we're the only ones doing using Go in production at Facebook. Join us! https://parse.com/about#jobs
Re: Facebook Go Libraries
#25OT but I think GitHub should show tabs as 4 columns. I find Go code is hard to read with all this whitespace.
https://github.com/facebookgo/httpcontrol/blob/e815eb2/httpc... (tab size 2)
https://github.com/facebookgo/httpcontrol/blob/e815eb2/httpc... (tab size 4)
https://github.com/facebookgo/httpcontrol/blob/e815eb2/httpc... (tab size 12, seems to be the maximum)
Unfortunately, there seems to be no such entry in the account settings. I'd love to set this value once and for all, or maybe once per file suffix (2 spaces for stuff.xml, 4 spaces for stuff.go).
Re: Facebook Go Libraries
#26Re: Facebook Go Libraries
#27Earlier quoted context omitted.
Or better, we should save source code files replacing tabs with spaces. That's the best practice that makes everybody happy.
The Go team has made the decision that the language supports tabs for indentation, and it’s enforced by `go fmt`.
Re: Facebook Go Libraries
#28Looks more like Naitik Shah's open-source libraries.
I wonder why these aren't under the main facebook account ( https://github.com/facebook ) o_O?
Re: Facebook Go Libraries
#29Earlier quoted context omitted.
The Go team has made the decision that the language supports tabs for indentation, and it’s enforced by `go fmt`.
While this is clearly the wrong decision, one has to applaud the Go team for building `go fmt` and thus putting and end to unproductive discussions about formatting. (Although it would have been nice if `go fmt` didn't change code semantics.)
It was my impression that gofmt was essentially a pretty printer. Can you point to examples where it changes semantics?
Re: Facebook Go Libraries
#30Earlier quoted context omitted.
We are talking about computer semantics which exist in a discretized world, not english language semantics. By your logic, the word integer would be any number not a fraction or decimal down to negative infinity up unto positive infinity. There is no concept of infinity on a computer. Anyways, that's besides the point, and I think you missed the meaning behind my comment. The reason why a tab space cannot semanticall…
I get what you mean but a tab is purposely meaningless and unqualified. It means 1 indent, not 8 spaces, 3 bananas or one tree. It is a unit. How the user displays that is up to them.
I used to hate tabs and want 2 spaces only, until I started working with other developers. Then suddenly tabs made sense, especially when you've got IDEs coercing every edited file to a person's indentation standard. Standardize on the tab and the pain goes away.