You should set visibility of the class members according to their place in the design, not according to the size of the class or any other considerations.
- If a method or a field represents or does something that is relevant to the way the class does its work, but not to the way the users of the class see what it does, mark the member private. The fancy name for this is "implementation details": you do not want to have them exposed to ensure that you can change them later on.
- If a method or a field is essential to what the class does for its users, make that member public: otherwise, nobody would be able to use that member, rendering the entire class useless.
- If your class is designed for inheritance, and a method or a field is prepared for exclusive use by this class and its subclasses, make that method protected.
- If a method or a field is an implementation detail that needs to be visible by other classes inside the same assembly, make the member
internal
. You can mixinternal
andprotected
, further restricting the access to derived classes inside the same assembly.
You should start doing this classification in your mind as you design your software. It is much easier to do this classification when you design smaller systems. However, the importance of doing it right grows tremendously as the size of your system goes up.