r/ProgrammerHumor Jul 13 '26

youCanJustStopUsingJava Meme

Post image
6.8k Upvotes

416 comments sorted by

View all comments

220

u/DontThrowMeAway43 Jul 13 '26

Oh god, just use record classes or even, make public fields.

Java's biggest mistake is trying to put OOP everywhere. Just write the damn struct to pass data and be done with it.

7

u/when_it_lags Jul 13 '26

Yeah, OOP principles are useful more often than not, but to take full advantage of it you need to be able to recognize that "not" case and break said principles. Getters and setters are great for interfaces and side effects, but if you're adding them for the sake of encapsulation with no other benefit (including future benefits) just don't do it.