Hi folks, a general question: is there any doc about why the kotlin-team decided to make kotlin classes by default final? Im looking something like a KEEP. I searched in the Keep, docs, and now im looking in the spec but i cant find any detailed explanation like in the keeps. Does anyone know if it even exists something similar? Thanks in advance for any answer 🙂
George
06/13/2022, 5:52 PM
I can pretty much understand the general concept which is i believe to promote more composition over inheritance, but nonetheless i was curious if there is any detailed design doc.
e
ephemient
06/13/2022, 5:57 PM
not Kotlin-specific, but see Bloch's Effective Java book, section "Design and document for inheritance or else prohibit it"
👍 3
🙏 1
m
mkrussel
06/13/2022, 5:58 PM
I believe the Kotlin team was heavily influenced by Effective Java and tried to make Kotlin fix many of those issues.
e
ephemient
06/13/2022, 6:09 PM
yes, that is my understanding as well - in many ways, Kotlin codifies good Java practices accumulated from Bloch and others