Alternatives to OOP in D

Andy Valencia dont at spam.me
Mon Sep 1 21:28:29 UTC 2025


On Monday, 1 September 2025 at 16:26:15 UTC, H. S. Teoh wrote:

> OOP is useful for certain classes (ha) of problems, but not 
> all, as the OOP proponents would like you to believe.  Some 
> classes of problems are better solved with other means.

Do note that I had to bite the bullet and write an OO File class, 
just so I could write emulated (but compilation/type compatible) 
subclasses of File.  String- and ubyte[]-based reader/writer 
instances, specifically.  Think Python's StringIO.

It sure made a number of things easy once I could use 
polymorphism wrt File.  I'm very glad that D has classic OO 
semantics available.

Andy



More information about the Digitalmars-d-learn mailing list