Program logic bugs vs input/environmental errors (checked exceptions)

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Mon Oct 6 08:07:01 PDT 2014


On 10/6/14, 7:48 AM, Jacob Carlborg wrote:
> On 06/10/14 15:45, Andrei Alexandrescu wrote:
>
>> Knowledge doesn't have to be by type; just place data inside the
>> exception. About the only place where multiple "catch" statements are
>> used to make fine distinctions between exception types is in sample code
>> showing how to use multiple "catch" statements :o). This whole notion
>> that different exceptions need different types is as far as I can tell a
>> red herring.
>
> What do you suggest, error codes? I consider that an ugly hack.

I don't. On the contrary, I do consider proliferating types to the 
multiplicity of possible errors an obvious design sin. -- Andrei




More information about the Digitalmars-d mailing list