DEV Community

Discussion on: Avoid getters and setters whenever possible

Collapse
 
scottshipp profile image
scottshipp

Sorry if it wasn't clear. First, I would recommend not making it public to begin with, and definitely not for 100,000 other classes to have access. If you need to make some validation before getting the value, definitely keep the variable private and expose a well-named method instead.