Is defining get/set methods for every field overkill?

Ali Çehreli acehreli at yahoo.com
Sun Nov 20 12:23:39 UTC 2022


On 11/20/22 00:31, [] () {} () wrote:

 > Quoted from that video (the one that you agree with):
 >
 > "I don't ever think that private .. private is like just .. shouldn't
 > even be used."
 >
 > "so I don't even use classes I just use struct so that everything is
 > always public .. and that in my opinion is the correct method."

Yes, still agreeing with it.

 > If anyone wants to learn more about why encapsulated types
 > (classes) have shown to be so useful in my many years of programming,

Hm. 'private' is about access control. Encapsulation is something else.

 > they can first pay me my fee.

If I could, I would like to pay to have less of that please. :)

Ali



More information about the Digitalmars-d-learn mailing list