Discuss: Classes are well supported in D, with Design by Contracts. Shouldn't we take advantage of that?

Brother Bill brotherbill at mail.com
Sat Sep 13 00:43:38 UTC 2025


I'm not clear about why 'class'es are on the 'avoid' list.

D has excellent support for Single inheritance, Interfaces, 
Design by Contract (DbC), GC, etc.
I'm aware that there is a small run time cost for selecting the 
right virtual method.

To reduce this cost, one must final-ize methods that don't need 
to be overridden.

Using classes is a major reason that I chose D.
Outside of Eiffel language, D comes closest to supporting DbC.
Even .NET has abandoned supporting DbC.




More information about the Digitalmars-d-learn mailing list