[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [LC++]Exceptions vs. Errors
On Thu, Apr 18, 2002 at 01:49:18PM -0400, Jack Lloyd wrote:
> I find the
> try/throw/catch syntax ugly enough that I don't like using it unless I have
> to.
>
You noticed that, too? I'm sure some people find it sublime, but I
don't. Plus, you _must_ include braces. You can't just treat it the way
you do "if":
if (something)
do_it;
else
dont_do_it;
No, with try/catch, you _have_ to have braces. This won't work:
try
action;
catch
fixup;
One other thought about exceptions is that, where you have mixed
exceptions/error codes, you have to remember which functions need
try/catches, and which can just test a return value.
Paul