5 ms·
Such as? In before: Unchecked exceptions that I can forget about instead of always handling the errors gracefully or consciously pushing down the stack.
by mixedCase 10y ago
Such as?
In before: Unchecked exceptions that I can forget about instead of always handling the errors gracefully or consciously pushing down the stack.
- coldtea 10y ago>Unchecked exceptions that I can forget about Not any more than you can forget about the returned error code in Go (val, _ := foo() etc). But with all the added convenience of exceptions. What you'd seem to describe, and which Go lacks, are Optionals that you have to handle for every option. And lots of other schemes (even Conditions).
- mixedCase 10y ago>Not any more than you can forget about the returned error code in Go (val, _ := foo() etc). I'm pretty sure that's an underscore right there, that very explicitly means "I'm consciously ignoring this error". Not sure what you're talking about with Optionals and Conditionals. Errors in Go are in the end structs that satisfy the error interface. That doesn't have to be an errors.Error, you can implement your own to satisfy more complex needs.