M
Mark Oueis
I've been struggling with this question for a while. What is better
design? To design functions to return error codes when an error
occures, or to have them throw exceptions.
If you chose the former, i have a few questions that need to be
answered.
1) What about functions that need to return a value regardless of the
error. How can they also return an error code unless the function has
"output" parameters. This seems messy and ridiculous.
2) What if the direct caller is not interested in the error. We will
have some kind of error code chain going on. This seems also messy.
If you chose the latter.
1) What about performance?
2) Is there no problem in having too many exceptions, which can cause
the function call to exit from too many places?
I'm sure there are questions concerning these issues that I have not
asked. If you can pose them and answer them I would be greatful.
Thanks a lot
Mark
design? To design functions to return error codes when an error
occures, or to have them throw exceptions.
If you chose the former, i have a few questions that need to be
answered.
1) What about functions that need to return a value regardless of the
error. How can they also return an error code unless the function has
"output" parameters. This seems messy and ridiculous.
2) What if the direct caller is not interested in the error. We will
have some kind of error code chain going on. This seems also messy.
If you chose the latter.
1) What about performance?
2) Is there no problem in having too many exceptions, which can cause
the function call to exit from too many places?
I'm sure there are questions concerning these issues that I have not
asked. If you can pose them and answer them I would be greatful.
Thanks a lot
Mark