Why is D unpopular

Chris Katko ckatko at gmail.com
Sun Jun 12 12:26:33 UTC 2022


On Sunday, 12 June 2022 at 11:49:21 UTC, Ola Fosheim Grøstad 
wrote:
> On Sunday, 12 June 2022 at 10:40:02 UTC, Max Samukha wrote:
>> Then it is natural to expect the feature would apply to the 
>> class level (if we are talking about class-based OOP)? Really, 
>> I'm yet to meet a D user that wouldn't be surprised 'private' 
>> is module-level. And the 'friend' story rarely impresses them. 
>> The reply is always: "Ok, 'friend' breaks OOP principles. Is D 
>> better because it breaks OOP in its own way?"
>
> Yes, of course, D could make private work like C++ and give 
> module access to protected instead.
>
> You could also allow reading of object attributes from the 
> module and restrict writing to the object (without using 
> properties).

If I could have private (or any keyword that mimics C++ private) 
as a optional compiler flag, I would turn that on in a heartbeat.


More information about the Digitalmars-d mailing list