how to make private class member private

psychoticRabbit meagain at meagain.com
Tue Mar 13 06:10:26 UTC 2018


On Tuesday, 13 March 2018 at 05:35:30 UTC, Amorphorious wrote:
>
> There is another problem:
>
> 3rd: You are a brainwashed monkey who can't think for himself.

Gee..takes some real brains to come up with that one.


> See, You learned a little about C++/C#/Java and think the world 
> must conform to what they say is correct and deny everything 
> that contradicts it rather than first seeing if you are on the 
> wrong side of the contradiction.
>
> The fact is, there is no reason a module should be restricted 
> to see it's own classes private members.

Yeah that sounds fine. As long as you're willing to give up the 
concept of class encapsulation.

And, as long as you are willing to have programmers use the same 
syntax in D, as used in the 3 most widely used lanaguages on the 
planet, but get very different semantics. It's a real gotcha for 
those programmers.


> It's sorta like a family who runs around pretending that they 
> can't see each others private parts. Sure, it sounds like a 
> good thing... until someone accidentally drops the towel and 
> the offended calls the cop on their brother and has him 
> arrested for breaking the law.

I'm not interested in your fanatasies. Keep them to yourself.

> You should learn that your view of the world is very minute and 
> stop trying to fit the world in to your box. It's called 
> growing up. If you can't make a distinction between C++ 
> encapsulation and D encapsulation you have far bigger problems 
> than you think.

I think the view of the 3 most widely used langauges on the 
planet, is not something to dismiss so easily. D has what, 1000 
programmers, maybe.. so I wonder whose world is really minute.

In any case, I'm not attacking D. I use it. I am just questioning 
whether the different semantics for private, in D, is really 
worth it.




More information about the Digitalmars-d-learn mailing list