2 ms·
Depending on the language, getters and setters may not be source and/or binary compatible with fields from the client side, so if you might ever need to refacto
by dragonwriter 6y ago
Depending on the language, getters and setters may not be source and/or binary compatible with fields from the client side, so if you might ever need to refactor to a nontrivial getter or setter (whether because you are changing representation or for other reasons), starting with trivial getters/setters instead of fields limits future breakage.