Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Use getters and setters" - Why would you start with getters & setters? #47

Closed
bluEEil opened this issue Apr 14, 2021 · 1 comment
Closed

Comments

@bluEEil
Copy link

bluEEil commented Apr 14, 2021

I don't understand this rule in the aspect of why would you add a getter / setter for a simple property with not logic?
The example demonstrates exactly how you can always take a regular property and refactor it easily only within the class to use a getter / setter without editing any of the usage of it (getters and setters act like regular properties outside of the class).
So with this in mind, why would you add getter / setter in advance for simple properties without any logic?

@dashtaki
Copy link

https://stackoverflow.com/a/1568230/2656499

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants