Why is D unpopular

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Mon Jun 13 12:44:11 UTC 2022


On Monday, 13 June 2022 at 12:34:56 UTC, Ola Fosheim Grøstad 
wrote:
> On Monday, 13 June 2022 at 12:03:10 UTC, Max Samukha wrote:
>> And the reason is the private member of the class shouldn't be 
>> accessible outside its declaration scope in the first place. 
>> Module-level 'private' is dysfunctional by design.
>
> It can be fixed, but I personally prefer granting other 
> entities «roles».
>
> C++ friend-mechanism is one variant of granting "roles".

I guess it is worth adding that one weakness in C++ (and D) is 
that functions are not objects (in contrast to Beta). If 
functions were objects and if the called function could inspect 
the caller's object-type then you could design a much more 
advanced regime and create interesting novel framework-mechanisms 
using meta-programming.




More information about the Digitalmars-d mailing list