Comment by ivan_gammel

4 months ago

Well designed non-trivial libraries should be open for extension and thus should not hide most of the implementation details, leaving the risk of too tight coupling to users. E.g. if I‘m not 100% satisfied with some feature of a library, I should be able to create a slightly modified copy of implementation of some class, reusing all internal utilities, without forking it. So no, modules as means to reduce visibility are not as cool as you think. And given the specific example of the list, it’s possible to filter out irrelevant suggestions for auto-complete or auto-import in IDE settings.

So goalpost moved from “libraries can solve visibility problem with package level visibility” to “libraries should not try to solve the visibility problem because it is not even a problem at all”?

  • No, it has not. If you are software engineer you should understand the difference between what I actually said and what you quote from logical perspective. I said "many libraries", not "all". For majority of use cases package level visibility is sufficient and is more granular. Yes, many libraries have already migrated and include module-info, but they still are fully compatible with classpath and actively use more classic mechanisms for visibility control. How many projects do use modules? I haven't seen a single one yet.