There has been debate about whether the default access control should be private or internal. It seems like having a class-level modifier would solve many of the complaints voiced in that thread.
Here are, I would imagine, the pros and cons of a class-level modifier to make things private:
- All the pros of private visibility by default (promotes good OOP encapsulation and leads to better build times)
- Allows people not to worry about private visibility if they don't want to
- Allows people not to worry about private visibility if they're still learning the basics
- Require each class to be changed for it to have private visibility
It might look like
@privateMembers class MyClass
It could also be generic for any visibility level, like
@memberVisibility(private) MyClass. I don't care either way, my main goal is to make private visibility easy. Or, maybe there's something better than a class-level modifier that still easily adds private visibility across many fields. Similar alternatives are welcome.