01 Jun 15, 09:28AM
(29 May 15, 10:47PM)Mousikos Wrote:(29 May 15, 06:58PM)TheNihilanth Wrote: Now in the strict sense of OOP if it were a class instead of a struct it would be a badly designed class because it's breaking a corner stone in OOP: Encapsulation, since member data is public, and it should be private and it should provide accessors and mutators as a means to change its state.
Well, yeah, I'd do that. I was taught to have member variables private and use getters and setters.
Getters and setters are good, if you use them where it's needed.
No need to have a struct/class with only getters and setters that only assign/get a value, then you can just make it public...