5 ms·
The Go standard library is throughly documented and implements all sorts of functionality (HTTP, crypto, libc-esque functionality) in a fairly minimal way: htt
by tekacs 10y ago
The Go standard library is throughly documented and implements all sorts of functionality (HTTP, crypto, libc-esque functionality) in a fairly minimal way:
https://github.com/golang/go https://github.com/golang/go
- pella 10y agoafter gofmt -> "Automatic source code formatting is becoming a requirement for any kind of language." https://talks.golang.org/2015/gofmt-en.slide https://talks.golang.org/2015/gofmt-en.slide ("The Cultural Evolution of gofmt) (2015) "Evolution in programming culture: -gofmt is significant selling point for Go -Insight is spreading that uniform "good enough" formatting is hugely beneficial. -Source code manipulation at AST-level enables a new category of tools. -Others are taking note: Programming culture is slowly evolving. "
- arthurcolle 10y agoThat talk is impossible to read on mobile (Safari, iOS 9 something)
- 0942v8653 10y agoUse the second bookmarklet from here: https://news.ycombinator.com/item?id=9414599 https://news.ycombinator.com/item?id=9414599 It will zoom out the slides and make them readable. Weird how that is necessary.
- edgyswingset 10y agoThe APIs that you as the programmer are supposed to invoke tend to be well-documented and fairly well-designed. But there's some parts in there I certainly wouldn't call elegant. For example, if you trace function calls from http.Get() you end up in a lovely function called doFollowingRedirects()[0] which is where the actual request is made inside of a for {} loop. Be it efficiency, some stylistic tendency I'm unaware of, or some contrived excuse that doesn't make any sense, at the end of the day I'm not likely to look for a function called doFollowingRedirects when I want to see where the initial (and likely only) request is made. [0]: https://github.com/golang/go/blob/master/src/net/http/client.go#L430 https://github.com/golang/go/blob/master/src/net/http/client...
- tekacs 10y agoI read `doFollowingRedirects` with an elided comma - that is, 'do, following redirects (as you go)'. In that context, the function doesn't seem so surprising. If you take a look at the function `Do`[0], you'll notice it calls out to either 'send' or 'doFollowingRedirects' depending on whether it's a request that should 'do, following redirects' or simply 'send a single request'. Many HTTP libraries I've seen are structured around creating a request object and then handing it to a 'do request' function - the crime here at best seems to be the naming 'doFollowingRedirects', which can be read as 'do the subsequent redirects' which might make it seem odd that the first request was included in the for loop therein.