4 ms·
> The important point of OOP is the visibility modifiers, OOP is not required for implementation hiding. It can be done entirely by convention (eg. names start
by usrbinbash 5y ago
> The important point of OOP is the visibility modifiers,
OOP is not required for implementation hiding. It can be done entirely by convention (eg. names starting with an underscore are internal and not to be used).
Go took this a step further and simply enforces a convention at compile time: Any symbol in a package not starting with an uppercase letter, is internal and cannot be accessed by the consumer.
- kaba0 5y agoWell yeah, and typing doesn’t need enforcement by compilers, we just have to manually check their usages. Maybe we should go back to Hungarian notation! I mean, snark aside, I really don’t think that variable/field names should be overloaded with this functionality. But I have to agree that this functionality is indeed not much more than your mentioned convention.