DEV Community

Discussion on: Encapsulate state and expose behavior when writing object-oriented code

Collapse
 
scottshipp profile image
scottshipp

Help us understand the motivation for a private setter. Why not provide only a getter and not have a setter at all?