|
|
|
|
|
by andyjohnson0
5154 days ago
|
|
[The following is speculation: I have no access to Google's code.] I can't think of any other way to handle errors apart from using return values. Methods return error codes which are handled by the caller or bubbled-up to its caller. This tends to result in lots of duplicated error handling code, and you have to either dedicate the return value to success/fail (which means you have to return non-status data some other way) or use special values to indicate failure. The Go language (from Google) doesn't have exceptions and allows functions to return a value and an additional error return value [1]. I'd guess that this is inspired by their approach to C++ coding. [1] http://code.google.com/p/go-wiki/wiki/Errors |
|