begin  quoting James G. Sack (jim) as of Sun, Jun 10, 2007 at 11:52:33AM -0700:
[snip]
> I would be happier with "catch unexpected behavior and do something
> "sensible" .. but maybe that's what you meant by "fix it".
> 
> Of course, deciding what's sensible is sometimes difficult, eh?

When in doubt, print a stack trace...

> ..and, I would add that "exceptions" should probably get reviewed rather
> than be buried or ignored. Especially "unexpected exceptions" <heh>.

C++ has exceptions. Only two problems with C++ exceptions:

(1) They're not accepted as universal, so "best practices" results in a
set of macros to "portably handle exceptions". You don't use try, you
use a MACROPREFIX_TRY, and a MACROPREFIX_END_TRY, and all that stuff...
plus you have to keep track of nested try-catch blocks, and use custom
throw macros, and so forth.  It makes the whole exception thing so
useless that you might as well not use it at all, which is, I suspect,
the point.

(2) You can't get meaningful information from an unknown exception.
Sure, you can "catch ( ... )", which will catch an unknown exception,
but you have absolutely no way of learning anything at all about that
exception. No stack traces for you!

But... C++ advocates get to say that C++ has exceptions. The fact that
they aren't really _useful_ doesn't mean they don't gleefully check the
little language-feature checkbox.

-- 
C++ might make a good intermediate output language for a compiler.
Stewart Stremler

-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to