|
|
|
|
|
by skybrian
17 days ago
|
|
This isn't like returning Object. It's more like returning a String. After using a language with a common String type, who wants to go back to writing code to convert between between different kinds of strings? Having to choose among different string implementations because there's no standard usually leads to boilerplate code doing conversions at the borders. Usually you just want to propagate or log errors, so having a generic error interface is sufficient. It's true that in Java, you can wrap exceptions, but that's extra boilerplate. (And yes, Go does notoriously have error propagation boilerplate that they should fix, but that isn't a type system problem.) |
|