|
|
|
|
|
by moe
3940 days ago
|
|
Error handling does obscure the business logic when, as in Go, nearly every operation needs to be followed by a boilerplate guard clause. Other languages (e.g. Java) have solved this problem quite elegantly over a decade ago with the introduction of Checked Exceptions[1]. Since this is the pattern that every Go program ends up emulating anyway, Google could save everyone a lot of work by just baking it into the language. In the eternal words of Larry Wall: The computer should be doing the hard work.
That's what it's paid to do, after all.
[1] https://en.wikipedia.org/wiki/Exception_handling#Checked_exc... |
|
foo, err := somebullshit()
if err != nil {
}I feel as though I've experienced a very slight but irrevocable grand mal seizure.