how to make private class member private

psychoticRabbit meagain at meagain.com
Tue Mar 13 13:08:44 UTC 2018


On Tuesday, 13 March 2018 at 08:44:48 UTC, Mike Parker wrote:
> Making modules the lowest level of encapsulation does that 
> without the need for an extra keyword for friends while still 
> maintaining a strict border between external and internal APIs. 
> Moreover, it restricts friends to the same module, easing the 
> maintenance burden and decreasing the chance of error. It was a 
> great decision.

Actually I wonder if it's the opposite of that, because now, if I 
have a bug in my class implementation, the code is no longer 
localised to the class, but to the module - this greatly 
increases the burden of program correctness and maintenance.

It also means the author of the class is no longer free to make 
changes, because all the surrounding code in the module needs to 
be assessed for impact - this greatly increases the burden of 
program correctness and maintenance.



More information about the Digitalmars-d-learn mailing list