For the most part in applications I've written, if the getter and setter aren't more complicated than your examples, you probably want to minimize the code as much as possible for readability, so the shorthand approach is very useful. On the other hand, if you implement more complicated logic in the getters and setters (for example validation or parsing of some sort), you want to make sure that no user class bypasses your logic.
Also, and as Binary Worner noted in a comment, it depends on what you need, and what you want. You know the difference between private
, protected
and public
, and thus you also know what you can and cannot do with your class depending on which one you choose. Which one is "the best" entirely depends on which behaviour you want (and don't want) to allow from other classes using this one.