Don't know if such questions might be discussed or proposed. Still I have to try ).
Kotlin is very promising language: it has a lot of nice, productive and safe features and still it’s integreated well with existing java ecosystem (as opposed to clever scala which is pain to integrate into java ecosystem because of different collection classes, different property naming and extra Option for nullness).
Still one thing makes some pain now and would do in future. This is final and suppressing inheritence by default.
There are two worlds in current java: user-space where we write code, where private’s are honored and code quality must be high. And some kind of meta-space where all introspection, AOP and other frameworks live (Spring AOP, Hibernate Validator, Hibernate ORM, Mockito and company). Theese could easyly access private’s through reflection, make proxies to whatch for methods and so. And this is OK. While I don’t want class extension in userspace, I don’t mind if serialization framework access private state to serialize it or if proxy is created to add transaction support or make some magical stuff with access recording.
Right now in Kotlin to enable it you have to write open open open all the way (properties, functions, classes). And it isn’t that you wish your class to be extensible in user space: you just need it for things to work.
There might be some kind of “hack” solution: to make this “default not-open” state Kotlin internal so to forbid such extension on user level but keep it non-final at bytecode level. While it’s agly and it’ll require platformFinal to make things really final for bytecode where it’s needed, it could keep user-space clean and expressive and allow tools to make their dirty but very usefull job.
What do you think about this topic? Are there other solutions or very open world is our future?