Adding a new design constraint to D

forkit forkit at gmail.com
Tue Jun 14 10:47:18 UTC 2022


On Tuesday, 14 June 2022 at 10:07:49 UTC, claptrap wrote:
>
> It leaves 99.9% of them going "Oh OK" and carrying on 
> programming.
>

well.. it didn't take long for the passive-aggresive types to 
come out of the woodwork...now did it.

my argument clearly lays out why I believe it is useful.

your argument is, 'it's not important to us - because you (me) 
are just the 0.1% , and we're the 99.9%'.

I don't find that a credible argument worth considering any 
further.


>
> The argument is this... "If you have access to the source code 
> of the module then you can already muck about with the 
> internals of the class, you ought to know what you're doing so 
> adding "strict private" doesn't actually gain you anything.
> 
> ...
>

the argument that I have access to the source file is a strawman, 
and will not be considered any further.

> It eliminates 99% of the need for it. The other 1% is a gift to 
> the gods of compromise in exchange for friend access between 
> classes that need it.
>

The decision to friend or unfriend should be a design 
consideration, and not a design constraint enforced onto you by 
the language.

D has removed the need to use C++ like friend.

Now I need a suitable, enforcable, design constraint, so i can 
unfriend.


>
> If "People coming from Java expect X" was a good argument for 
> adding X then D would just be Java.
>

I don't know why Java always comes up??

I'm coming from C#.

In any case, C#, C++, Java, Swift..etc.. are arguably, one of the 
most widely used programming langauges in the world. The concept 
already exists across these languages. Millions of programmer 
already work with this concept (although apprarently it's not as 
clear cut in Java as one would expect).

What you're saying is, either these millions of programmers don't 
really need this feature, or they just don't need it in D. I 
cannot find the basis for either assertion in your response.


>
> The onus is on you to demonstrate a genuine need for it other 
> than it's just what people expect.

I'm pretty sure that's exactly what I've done.



More information about the Digitalmars-d mailing list