Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C++
Error codes vs. exceptions
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Gerhard Fiedler, post: 5026809"] This is what I do, mostly -- besides having an overall exception design. For me, and this has already been said here a few times, return codes are something local, typically a function that returns a status of some sort that is directly used by the immediate caller, often as integral part of the caller's logic. In such cases, exceptions are not useful. OTOH, when the user of the error information is not clear and may be several call levels above and stack unwinding is desired, exceptions are a clear winner. There are some in-between cases, but IME they are not that frequent -- and it's mostly a choice of (personal or company or existing code base) style. For example, I've seen both exceptions and conditions being used to end a recursion. Depending on the case, to me both have their merits here. Gerhard [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C++
Error codes vs. exceptions
Top