Hacker News new | ask | show | jobs
by jiggy2011 5264 days 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?
1 comments

It'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)