4 ms·
In practice this is not a problem that is encountered pretty much ever. If you are afraid of it, run errcheck[1] on your code, and it'll tell you if you've mis
by NateDad 12y ago
In practice this is not a problem that is encountered pretty much ever. If you are afraid of it, run errcheck[1] on your code, and it'll tell you if you've missed anything.
[1] https://github.com/kisielk/errcheck https://github.com/kisielk/errcheck
- MereInterest 12y agoIf you don't mind me asking, what is it that keeps it from coming up? I understand that the multiple return values help, since then you don't need to go with the clunky C-style of passing in pointers that will be used as output. Error codes always feel like they rely too much on everybody deliberately following good coding practice, since the default is to ignore the error code. I prefer using exceptions, because then the error can't be ignored by default, and must be explicitly silenced if it is not desired. Then again, that is a large python influence on me.
- bad_user 12y agoI also think the arguments against using exceptions are flawed. For example it's a common pattern to use a supervisor that catches exceptions and depending on context and severity, to log the errors, to restart the guilty component, to send an error report, to fallback to something else, to crash the whole process and so on. The idea being that unexpected errors happen and you need to react to them in some way, preferably without relying on the developer to do something for everything potentially error prone that he does, because we can't anticipate everything bad that can happen, yet in spite of this, we can make the system resilient to errors.