VentureFree
Well-known member
- Joined
- Jan 9, 2008
- Messages
- 54
- Programming Experience
- 5-10
This is probably a stupid question, but when accessing an attribute from within a class is it generally better to access the private variable directly, or access it using the getter/setter? Of course the whole point of encapsulating attributes is to allow changes to the underlying code without affecting anything that uses it. Should that also apply to the class itself? Or is it a case where the class should have full knowledge, and so shouldn't have to use the getters/setters?