Re:A Healthy Hatred of OOP, or the principles of my message-...
by UK-AL on Tuesday April 12, 2016 @12:04PM
(#11480753)
Problem is developers take that as an excuse to make state public, which is even worse.
Re:A Healthy Hatred of OOP, or the principles of my message-...
by kasey_junk on Tuesday April 12, 2016 @02:01PM
(#11481940)
It doesn't matter whether you make the state public via a getter or via variables (modulo some compiler specific reasons to use accessors).
If your design is allowing some external actor to work with multiple parts of the state of a behavior driven object (ie not a record) accessors are not going to help you, you've still exposed the state.
This needs to be tattooed in reverse on many developers foreheads so it's the first thing they read when brushing their teeth in the morning.