Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Short answer: www.yegor256.com
Long answer: Getters/setters supposedly make your classes/objects less OO. Since most will tend to over-abuse them and turn all of their classes into "dumb" databags. OO dictates that any data should not be exposed to anyone. You ought to expose only the flow of logic/interaction of objects but never more.
While that sounds nice and all, actually trying to stand by those values in the real world translates to pure pain. Workable for small projects, borderline impossible for bigger ones.
Related Rants
Setter and getter are anti-patterns. Eradicate all of them from your code with no mercy and you'll see your code magically transform for the better.
undefined
been-there
done-that
wk66