Alternatives to OOP in D

solidstate1991 laszloszeremi at outlook.com
Sun Nov 9 20:40:45 UTC 2025


On Monday, 1 September 2025 at 13:58:23 UTC, Brother Bill wrote:
> I have heard that there are better or at least alternative ways 
> to have encapsulation, polymorphism and inheritance outside of 
> OOP.
>
> With OOP in D, we have full support for Single Inheritance, 
> including for Design by Contract (excluding 'old').  D also 
> supports multiple Interfaces.
>
> What would be the alternatives and why would they be better?
> I assume the alternatives would have
> 1. Better performance
> 2. Simpler syntax
> 3. Easier to read, write and maintain
>
> If possible, please provide links to documentation or examples.

At least my game engine PixelPerfectEngine uses Entity Component 
System (ECS) for game logic stuff, with the ability of soft 
opting out from it.


More information about the Digitalmars-d-learn mailing list