3 ms·
I don't understand the objection here to getters and setters. Sometimes part of the public interface of an object is as simple as a property that can be read o
by sah 18y ago
I don't understand the objection here to getters and setters. Sometimes part of the public interface of an object is as simple as a property that can be read or written.
Is the idea just that a large number of getters and setters are a good indicator of poorly chosen encapsulation boundaries? I haven't seen code go wrong that way.
- dmoney 18y ago> Sometimes part of the public interface of an object is as simple as a property that can be read or written. I agree. In fact, I'm having trouble envisioning a program without any of these (or clunky workarounds to avoid them).