3 ms·
> Just return the io error Manually, on every function call that may fail - that was my only point why exceptions may result in a clearer code. section, e
by drdaeman 12y ago
> Just return the io error
Manually, on every function call that may fail - that was my only point why exceptions may result in a clearer code.
section, err := parseSection(ioReader)
if err != nil { return nil, err }
Has some boilerplate, as compared to a typical exception-based
section = parseSection(reader) // throws IOError
- zimbatm 12y agoYeah I get what you mean. If you forget that "throws" comment then the Java code is opaque to the exception. I think Go developer see a value in having errors exposed explicitly, it forces them to think about how to handle them instead of having a catch-all at the top of the program. But now we're down to philosophy and personal taste :)