3 ms·
They could easily add more visibility levels (by using keywords like Java). They haven’t because it’s unnecessary and confusing.
by s17n 9y ago
They could easily add more visibility levels (by using keywords like Java). They haven’t because it’s unnecessary and confusing.
- andyfleming 9y agoI wasn't necessarily advocating they add _additional_ visibility levels, but they already have at least 2. They are just implicit by capitalization as opposed to explicit with "public" and "private" keywords.
- zaphar 9y agoBoth are explicit. One uses a keyword the other uses capitalization. The compiler will still complain if you use a private method in either one. You can argue about whether one is more or less readable than the other but you can't say they aren't explicit.
- andyfleming 9y agoYeah, I guess you are technically correct as far as being explicit. Maybe intuitive is a better description. A newcomer could read public/private and quickly understand its meaning as opposed to capitalization being a learned convention.
- pdpi 9y agoLet’s say they add keywords. What happens then? How does that interact with the current rules, and with people’s ability to interpret code?