Kotlin to support package protected visibility

I very strongly agree with the arguments that @vach, @norswap and @kirill_rakhman have made here for a stronger tool than simply internal.

@yole One can obviously understand the idealist motivations that you state regarding package-private being an imperfect protection scheme. The problem is not with Kotlin’s lofty rationale. Instead what you are seeing expressed in this thread is the very practical frustration over the lack of a replacement solution in Kotlin.

Instead of the two more user-acceptable options of either
A) retaining Java 6’s horribly lousy visibility vocabulary, or
B) architecting and providing a superior system than Java’s;
Kotlin punted on the issue provides neither.

Again, it’s understandable for JetBrains to have considered the stance that it took when designing Kotlin (ie. it’s understandable that when given the chance to create a clean new language, one would rather everything be squeaky perfect, and that time might not have been available to come up with a better way just yet; and that maybe it wasn’t predicted to hurt JetBrains’ own typical usage patterns and thus not a high priority; and maybe even that Project Jigsaw was already known of and it was thought that Kotlin could wait for it; and not to mention any potential private goals of eclipsing the JVM altogether). However, as the legitimate and common examples listed in multiple people’s posts here illustrate, this IS a painful part of working in Kotlin for many developers who aren’t JetBrains (at the very least), and an expressed recognition of this issue — at the least — could go a very long way.

9 Likes