The Right Approach to Exceptions

Walter Bright newshound2 at digitalmars.com
Sat Feb 18 19:31:00 PST 2012


On 2/18/2012 3:13 PM, Andrei Alexandrescu wrote:
> On 2/18/12 4:26 PM, Jonathan M Davis wrote (abridged):
> GetOptException
> FlagArgumentMissingException
> InvalidFlagArgumentException
> UnknownFlagException
> FileException
> FileNotFoundException
> NotFileException
> NotDirException
> AccessDeniedException
>
> I died inside a little.

I think typed exceptions are a good idea, but something looks wrong with these.

(Also, having a large number of exception types is going to produce a lot of 
program size bloat. Remember, for EVERY class type, you've got the vtbl[], the 
.init data, and the TypeInfo. Going to town on exception types can really add 
this up.)


More information about the Digitalmars-d mailing list