Why is D unpopular

forkit forkit at gmail.com
Tue Jun 14 00:42:40 UTC 2022


On Monday, 13 June 2022 at 12:33:32 UTC, jmh530 wrote:
>
> A fair point, but one of the arguments (over who knows how many 
> pages at this point...) is that some people want to be able to 
> have some way to ensure that the only way to access internal 
> members is controlled through the class itself. You would reply 
> that there is an alternative, which is to put that class in a 
> separate module. It is a little like @safe (in a project with 
> no dependencies, is @safe useless because the programmer has 
> access to all the code and can verify themselves whether there 
> are any errors?). Some people want guarantees. The people 
> arguing for this want the guarantee that if they write some 
> other function *in the module* that tries to access one of this 
> internal members, then they get an error. Now, that's not 
> something that has been a concern to me, but I don't 
> necessarily think it is a useless feature.

of course, this is primarly a matter of scale (both in terms of 
code, and people contributing to that code - even withint the 
same module, and not just now, but in the future as well).

the only way to scale in D when using OO designs, without this 
feature, is to put every class on it's own in it's own module - 
for no other reason than to protect the code of the class from 
any other code.

that is not scalable.

sure, some choose to put one class per file - that is a design 
decision - not one that should be forced on to you, by the 
language, because the language refuses to provide the tools you 
need.

you should be able to protect the code of your class, from 
surrounding code, without being told this is the only workaround 
we can provide for you.

there is no downside to having an option to contain private parts 
to the scope of a class. What a complete joke to suggest there is.

people will choose to use it , or not - but they'll have a choice.

of course I already have that choice, in ALL the languages I 
currently use - except for D. Every C++/C#/Swift/.../.. 
programmer can already do this.

There is a strong 'anti' class-private group in the D community.

There motivations are their own, and not all that clear to me.

But they sure are intent on ensuring i (and everyone else that 
uses D) don't have that choice.



More information about the Digitalmars-d mailing list