On Tuesday, 13 March 2018 at 09:52:06 UTC, Mike Parker wrote:
On Tuesday, 13 March 2018 at 09:14:26 UTC, psychoticRabbit
That's make a little uncomfortable, given how long and complex
modules can easily become(and aleady are)
Is there a practical difference between a) a module that
contains a class with 20 member functions all accessing private
members of the class and b) a module that contains a class with
two member functions and 18 free functions all accessing
private members of the class? Does it really make a difference
that some functions are on one side of a closing brace and some
on the other?
The scenario you mentioned is fine, as long as I don't want to
protect any of my class members from free functions within the
module. When I do decide that something in my class really does
need protection, I have to move the class outside of the module.
This concept is new to me. I have to keep thinking about it. To
lose control at the level of class encapsulation, and surrender
it completely to the module, no matter what..well..I'm a little
unsure about it.
I'd be more comfortable with being able to have your scenario and
mine 'both work'.
At what point, does 'principled' violation of encapsulation, just
become a violation of encapsulation?