<<< OOP Philosophy Notes | Index | Friends make exceptions from access control rules >>> |
Data members give you an implicit interface.
Member functions provide explicit interface carefully chosen by a programmer.
Encapsulation controls both the explicit and the implicit interface to your object.
Keep all data private, provide meaningful public functions
Some novice programmers like to accept free "gifts" from the compiler (read: implicit interface of public data members) which easily becomes a huge problem down the road.
<<< OOP Philosophy Notes | Index | Friends make exceptions from access control rules >>> |