K
kk_oop
Hi. I wanted to use exceptions to handle error conditions in my code.
I think doing that is useful, as it helps to separate "go" paths from
error paths. However, a coding guideline has been presented that says
"Use conventional error-handling techniques rather than exception
handling for straightforward local error processing in which a program
is easily able to deal with its own errors."
By "conventional error-handling," I believe they mean returning an
error code, or just handling the error without going to a catch block.
When I said that I'd prefer throwing and catching exceptions--and that,
in fact, exceptions is the "conventional error-handling technique" in
Java, I was told that since we have a real-time system, we can't afford
the performance hit caused by using exceptions.
Do exception blocks cause big performance hits? If so, what causes the
hit? Or is the person just misinformed?
Thanks for any info,
Ken
I think doing that is useful, as it helps to separate "go" paths from
error paths. However, a coding guideline has been presented that says
"Use conventional error-handling techniques rather than exception
handling for straightforward local error processing in which a program
is easily able to deal with its own errors."
By "conventional error-handling," I believe they mean returning an
error code, or just handling the error without going to a catch block.
When I said that I'd prefer throwing and catching exceptions--and that,
in fact, exceptions is the "conventional error-handling technique" in
Java, I was told that since we have a real-time system, we can't afford
the performance hit caused by using exceptions.
Do exception blocks cause big performance hits? If so, what causes the
hit? Or is the person just misinformed?
Thanks for any info,
Ken