The Right Approach to Exceptions

Andrei Alexandrescu SeeWebsiteForEmail at
Tue Feb 21 08:57:20 PST 2012

On 2/21/12 10:50 AM, Juan Manuel Cabo wrote:
> I thought that an alternative to Variant[string] would be to have some virtual
> functions overrideable (getExceptionData(string dataName) or something).
> but they would all have to return Object or Variant, so it's the same thing.

Exactly. By and large, I think in the fire of the debate too many people 
in this thread have forgotten to apply a simple OO design principle: 
push policy up and implementation down. Any good primitive pushed up the 
exception hierarchy is a huge win, and any design that advocates 
reliance on concrete types is admitting defeat.


More information about the Digitalmars-d mailing list