4 ms·
Aside from issues with the type system and composability, it's just an impractical idea that stops working smoothly in anything bigger than toy projects. From
by groestl 3y ago
Aside from issues with the type system and composability, it's just an impractical idea that stops working smoothly in anything bigger than toy projects.
From a caller's perspective, "res, err :=" and "throws Exception" is the same thing: you need to handle the error on site, which (in contrast to the Go gospel), is not a good thing. In the absolute majority of cases it can't be done sensibly there, you need to pop it up the stack to a place which has more context. Certainly, it's none of a method implementor's business to decide "if a client can reasonably be expected to recover from the error". You know nothing, Jon Snow.
Java has figured out it's a bad concept decades ago, but Go is frustratingly re-enacting Java's early mistake. At least, redeclaring a checked exception was a simpler way of dealing with the error than Go's err ceremony.