Hacker News new | ask | show | jobs
by imajes 3212 days ago
hey, curious why your variables in the go version are so terse? makes following along a little tough!
1 comments

It is Go 'style'.

The abstractions are supposed to be self explanatory and simple and thus the variable names do not have to serve as documentation.

I think it is Go style to name things that come in as interfaces with short names. When you have an io.Writer, there's very little else you can name it other than "w" that would have any additional meaning or utility. When you have a variable or struct field of a concrete type, it can and should have a meaningful name, even in Go.

Ironically, I see several "input io.Reader" sort of things in that code, where as "number of hash functions" is k. A few minutes with go-rename would clean that right up, though.

Go to https://golang.org/pkg/net/http/#Client and use your browser to search for the string "struct {" and have a look. https://golang.org/pkg/os/ is another page with a number of struct declarations.