“Cargo cult programming is a style of computer programming characterized by the ritual inclusion of code or program structures that serve no real purpose.”
GETTERS AND SETTERS THAT DO NOTHING BUT WRAP VARIABLES THAT COULD BE PUBLIC
I will defend that practice!
if double price is public, I can never do anything with price.
If setPrice() is public, I can later e.g. switch from updating the price once per day on a timer to updating the price every time setPrice() is called.
So get/set for primitive variables does have a purpose: The redirecting layer allows me to expose an interface to you without forever being tied to the explicit implementation beneath. It might not do anything today but it keeps the technical debt lower.