I can think of plenty of reasons why you'd want a distinction between private and protected, especially in the case where you're designing a base class that you expect others to inherit from.Originally Posted by BerislavLopac
I could very easily argue that you don't "need" anything other than private, because you should be doing all variable access through getters and setters. Hell, I could argue that you don't need any member variables at all.
The things exist because they're useful. If something is useful enough to make sense to a large percentage of users, then it should be considered (and weighed against possible drawbacks, development time, other ways of implementing, etc.) This is true for any feature of any language.




Bookmarks