how to make private class member private
psychoticRabbit
meagain at meagain.com
Sun Mar 18 09:56:31 UTC 2018
On Sunday, 18 March 2018 at 05:01:39 UTC, Amorphorious wrote:
>
> The fact is, the creator of the class is also the creator of
> the module.. and preventing him from having full access to the
> class is ignorant. He doesn't need to encapsulate himself.
> Encapsulation is ONLY meant to reduce dependencies. If the
> programmer, probably someone like you, can't trust himself to
> understand his own code then he shouldn't be coding.
>
btw.
I am talking here about 'encapsulation' not 'information hiding'
(although the two terms are often considered related).
Clearly, there is no point in hiding information contained within
the module, from the implementer of the module. That's just silly.
However, are there no scenarios in which the person writing that
module, would not want to encapsulate their class, or some parts
of it, from the rest of the module (while not being forced to put
the class in it's own file)?
If the answer is certainly no, not under any circumstances, then
fine, my idea is not worth any further consideration.
And by no, I mean no for all, not just you.
More information about the Digitalmars-d-learn
mailing list