Re:Alan Donovan and Brian Kernighan Answer Questions on Go
by pcwalton on Friday November 20, 2015 @12:33PM
(#10602472)
This is not a good example of how Go makes it easy to ignore errors (which it does in some cases, but not in that way). You had to acknowledge the dropped error syntactically.
[ Parent
| on HN ]
Re:Alan Donovan and Brian Kernighan Answer Questions on Go
by jamwt on Friday November 20, 2015 @04:38PM
(#10604045)
A better example is the timeless:
err := f1()
if err != nil {..} // have to do this or compiler error
err = f2()
// oops, forgot to actually do anything about it!
Now, granted, `go vet` helps with this, but.. these kinds of things can be solved by the language proper in much better ways, and they should be type errors. Like rust's `Result` or Haskell's `Either`.Edit: rust's result is especially nice with #[must_use]. This has saved my team from mistakes relatively frequently.