2 ms·
There are some good points in there, but it doesn't help his case that he writes some of the Go examples in an unnecessarily contrived way. The first snippet ca
by majewsky 9y ago
There are some good points in there, but it doesn't help his case that he writes some of the Go examples in an unnecessarily contrived way. The first snippet can be rewritten as:
import (
"io"
"log"
"os"
)
func main() {
var (
r io.Reader
err error
)
if len(os.Args) > 1 {
r, err = os.Open(os.Args[1])
} else {
r = os.Stdin
}
if err == nil {
err = io.Copy(os.Stdout, r)
}
if err != nil {
log.Fatal(err)
}
}
EDIT: One more quip:
> I’ve always thought that the developers at Google are hand picked from the brightest and best on Earth. Surely they can handle something a little more complicated?
The point of Go is to ask if they really really have to. In my experience, there is much value to be found when colleagues can jump into your code for a drive-by contribution and start being productive on the first day.