Is defining get/set methods for every field overkill?


Sun Nov 20 03:14:24 UTC 2022


On Saturday, 19 November 2022 at 23:05:30 UTC, thebluepandabear 
wrote:
>
>..

btw. Although this thread has well and truly exhausted it 
usefulness, the question you posed primarly relates to 
encapsulation, and as such, I think Scott Myers provided a 
reasonable answer to your question - more than 2 decades ago:

"Encapsulation is a means, not an end. There's nothing inherently 
desirable about encapsulation. Encapsulation is useful only 
because it yields other things in our software that we care 
about. In particular, it yields flexibility and robustness."

https://www.drdobbs.com/cpp/how-non-member-functions-improve-encapsuhttps://www.drdobbs.com/cpp/how-non-member-functions-improve-encapsu/184401197



More information about the Digitalmars-d-learn mailing list