4 ms·
By definition protected/private modifiers aren't convention as they're part of the language itself. Convention is something that doesn't exist in the language.
by wvenable 9y ago
By definition protected/private modifiers aren't convention as they're part of the language itself.
Convention is something that doesn't exist in the language. You cannot mark properties as private or protected in Python so the convention is that underscore means private or protected. There are no getters or setters in Java so the convention is to use a method with a get/set prefix.
I would argue that such a common programming practice (enforced or not) should not be left to convention.