Quantcast
Channel: Why use getters and setters/accessors? - Stack Overflow
Viewing all articles
Browse latest Browse all 38

Answer by Jorge Aguilar for Why use getters and setters/accessors?

$
0
0

Well i just want to add that even if sometimes they are necessary for the encapsulation and security of your variables/objects, if we want to code a real Object Oriented Program, then we need to STOP OVERUSING THE ACCESSORS, cause sometimes we depend a lot on them when is not really necessary and that makes almost the same as if we put the variables public.


Viewing all articles
Browse latest Browse all 38

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>