3 ms·
A class that holds data and has no methods other than get/set is basically a struct. Why even bother with the get/set methods? You assert that code based on th
by geophile 10y ago
A class that holds data and has no methods other than get/set is basically a struct. Why even bother with the get/set methods?
You assert that code based on this approach is easier to understand, but you don't give a reason why this is so.
This sounds a lot like a pre-OO approach to organizing code and data, and I don't understand the benefits. To use the tried-and-true example: I want my stack state and code to go together. Why would I want to expose the stack state, and keep the code manipulating it separate?