3 ms·
Why does everything have a getter/setter by default? That is a pretty horrible anti-pattern, is it something to do with being able to serialise the state (inclu
by jiggy2011 15y ago
Why does everything have a getter/setter by default?
That is a pretty horrible anti-pattern, is it something to do with being able to serialise the state (including internal state) of the whole object?
- hackinthebochs 15y agoIt's about hiding implementation. If you access an object only through methods then the implementation can change without the client code having to know or care (aka be recompiled)