The Right Approach to Exceptions

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Feb 19 08:27:02 PST 2012


On 2/19/12 2:21 AM, H. S. Teoh wrote:
> Getopt isn't really the best use case for elaborate exception
> hierarchies. Perhaps we should use file I/O or network/socket I/O
> instead.

This is exactly what we should avoid: regressing to well-trodden ground. 
We shouldn't discuss OOP only in terms of Animal and Mammal, and we 
shouldn't discuss exceptions only in terms of IOException and 
NetworkException. We should look at the "uncomfortable" cases.


Andrei


More information about the Digitalmars-d mailing list