Non-ugly ways to implement a 'static' class or namespace?

ProtectAndHide ProtectAndHide at
Wed Feb 15 20:10:31 UTC 2023

On Wednesday, 15 February 2023 at 20:01:12 UTC, bachmeier wrote:
> On Wednesday, 15 February 2023 at 19:44:50 UTC, ProtectAndHide 
> wrote:
>> A user-defined type is a type that has a mechanism to keep it 
>> representation private.
>> D does not support this. It only enables it.
>> You (and others) may well argue that D should not enable this 
>> (directly), it should only support it (indirectly), and thus 
>> allow the language to force an important design decision onto 
>> programmers.
>> As a programmer, I don't think that is acceptable.
> The response was to your claim that "I think what you could say 
> is that D lacks _encapsulation_ which is also an OOP concept. 
> So D is partially OOP but not fully OOP due to there being no 
> encapsulation in the language."
> Mike demonstrated clearly that your claim is false.

My claims are factually correct.

What Mike is arguing, is that I don't need a 'data hiding' 
mechanism for a user-defined type, because that is already 
provided to me by the 'data hiding' mechanism of the module.

That is his argument.

My argument is that I want 'data hiding' mechanism at the 
user-defined type level as well.

Again, his argument is that i don't need it.. because...

And my argument is, that I want it...

And his arguement is, that I don't need it..




More information about the Digitalmars-d-learn mailing list