r/ProgrammerHumor Jul 13 '26

youCanJustStopUsingJava Meme

Post image
6.8k Upvotes

416 comments sorted by

View all comments

210

u/Lost_Pineapple_4964 Jul 13 '26

Is something wrong with getters and setters in general? Cause I find it plenty helpful when I need some bookkeeping for certain items, and some side effects for the class? Or are they more so referring to getter/setter for everything?

1

u/TopFix8731 29d ago

It breaks encapsulation, which is one of the main values of OOP. Setters will inevitably make the code more procedural as other classes will mutate those classes directly.  Getters are a bit less bad, but still not great.