Live data from Hacker News

Facebook Go Libraries

github.com

31–40 of 98 posts

Re: Facebook Go Libraries

#31

Earlier quoted context omitted.

The dictionary in front of me disagrees: "A key on a computer keyboard that, when pressed, inserts a special ASCII character used for formatting text, as in indenting a line or block of text." Actually going back it means tabulation which was an early form of alignment of tables on typewriters. The tab key advanced the carriage to the next tabulation point. It was repurposed as a way of indenting code later and it ha…

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…

> There is no concept of infinity on a computer.

Sure there is: http://en.wikipedia.org/wiki/IEEE_754-1985#Positive_and_nega...

Re: Facebook Go Libraries

#32
Is there any repo of Facebook D code? I thought they were making an investment in D. But this is a bit surprising because it seems possible that they use more Go than D.

Re: Facebook Go Libraries

#33
I have no idea how to evaluate this, or even tell what it is. Could someone help me out?

I see that it's a bunch of packages, under the heading of "Facebook Go". I assume this is something related to Google's Golang?

I click on "tool" ("Go library that wraps the go tool"). This has a README that points to a documentation link. And that documentation says things like, "Build the Command and return the path to the binary."

So, I guess we're talking about some kind of compiler here? A Golang compiler? How to I get it, how do I use it, and what -- if anything -- does this whole mess have to do with Facebook?

Re: Facebook Go Libraries

#34

Earlier 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.)

Wait, why is it clearly the wrong decision? I think using tabs for indentation is great.

I agree gofmt is amazing, and for any language I'd happily trade whatever my personal style is for consistency and and gofmt-like tool.

Can gofmt really change semantics? I would assume that's a bug?

Re: Facebook Go Libraries

#35

Earlier quoted context omitted.

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.)

I'm relatively new to Go, and like you I wholeheartedly agree with the idea of solving formatting once and being done with it (and as an aside, I agree that tabs are the wrong decision). It was my impression that gofmt was essentially a pretty printer. Can you point to examples where it changes semantics?

go fmt will reorder your imports, which means that if there is an import ordering dependency, it will either be exposed (or hidden) by go fmt.

Re: Facebook Go Libraries

#36

Earlier quoted context omitted.

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.)

I'm relatively new to Go, and like you I wholeheartedly agree with the idea of solving formatting once and being done with it (and as an aside, I agree that tabs are the wrong decision). It was my impression that gofmt was essentially a pretty printer. Can you point to examples where it changes semantics?

It does not change semantics. If it does in some case, that's a bug and please report it.

Edit: I see, import order can affect the order that the init()s in different packages are invoked, presumably. I stand corrected.

Edit 2: But that should not matter since the language doesn't specify any dependence on that.

Re: Facebook Go Libraries

#37
post #34

Earlier quoted context omitted.

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.)

Wait, why is it clearly the wrong decision? I think using tabs for indentation is great. I agree gofmt is amazing, and for any language I'd happily trade whatever my personal style is for consistency and and gofmt-like tool. Can gofmt really change semantics? I would assume that's a bug?

It not a particularly interesting discussion to have. The short of it is, if you only ever use one tool (or family of tools) to look at code (say an IDE), then tabs are not unreasonable. Once you start using multiple families of tools on multiple machines, now you have to maintain T*M tab configurations, which is awful.

The "standard" alternative (e.g. the google c++ style guide) advises 2-space indentation with 80 column lines. That specific format works well with almost every tool in existence. Tabs, not so much.

You can google "jwz tabs" to get a more in depth discussion. It's not a "big" deal, and as noted, in many ways it's better to standardize on the "wrong" decision than to constantly hash it out over formatting sugar.

Re: Facebook Go Libraries

#38

Earlier quoted context omitted.

The dictionary in front of me disagrees: "A key on a computer keyboard that, when pressed, inserts a special ASCII character used for formatting text, as in indenting a line or block of text." Actually going back it means tabulation which was an early form of alignment of tables on typewriters. The tab key advanced the carriage to the next tabulation point. It was repurposed as a way of indenting code later and it ha…

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…

Semantics is contingent upon meaning. Meaning varies and changes. Meaning is defined over time. That's the case with most words. In formatting text, it's as semantic to say that tabs are for "tabulation" and "indentation" as much as spaces are for "space" and "spacing characters." Tabs have always been semantically better as indentation in computing.

Re: Facebook Go Libraries

#39
post #33

I have no idea how to evaluate this, or even tell what it is. Could someone help me out? I see that it's a bunch of packages, under the heading of "Facebook Go". I assume this is something related to Google's Golang? I click on "tool" ("Go library that wraps the go tool"). This has a README that points to a documentation link. And that documentation says things like, "Build the Command and return the path to the bina…

The name of the language is Go, not Golang. This is a collection of tools and libraries for Go that Facebook has developed. I don't see any compiler, though one of them wraps the Go tool that is used to compile Go programs.

Re: Facebook Go Libraries

#40
post #4
post #2

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.

Why? n spaces encode a specific preference for indentation, while tabs just represent a level of indentation. How many columns these actually are is entirely up to personal preference and editor configuration. That's why tabs are always superior for indentation.
Post reply on HN