The Right Approach to Exceptions

so so at so.so
Sun Feb 19 07:50:17 PST 2012


On Sunday, 19 February 2012 at 00:50:07 UTC, Jonathan M Davis 
wrote:
> On Saturday, February 18, 2012 16:46:43 H. S. Teoh wrote:
>> I can't believe something this simple has to be explained so
>> elaborately. I thought all of us here knew how to use OO??
>
> I think that the problem stems from people frequently using 
> exceptions incorrectly, and many of the C++ programmers 
> probably haven't _ever_ seen them used correctly, since I don't 
> think that it's very common for C++ programs to define 
> exception hierarchies - especially not advanced ones like Java 
> has. And when you see a lot of bad exception code, that tends 
> to turn you off to them, and it definitely doesn't show you how 
> to use them correctly.
>
> - Jonathan M Davis

Problem is, "no one" using exception handling correctly including 
language experts. There is no consensus on where they are useful 
or not. Neither articles nor codes help you. Go read every single 
one of them and come back and code something. I invested a lot of 
time on it, yet i am now using it when i need an aggressive 
assert.

It is a great idea but incomplete.


More information about the Digitalmars-d mailing list