I hate class destructors with a burning passion

Walter Bright newshound2 at digitalmars.com
Wed Jun 9 21:37:45 UTC 2021


On 6/8/2021 9:58 PM, Andrei Alexandrescu wrote:
> Throwing constructors are an important part of achieving good encapsulation 
> because they allow avoiding "invalid" states of objects altogether. In fairness, 
> the fact that D has no user-definable default constructors weakens that argument 
> (and is a weakness of the language itself that we'd do good to fix).

Hence our disagreement :-)

BTW, over the years I've been evolving towards the notion that exception 
handling is a mistake.


More information about the Digitalmars-d mailing list