Hi folks, a general question: is there any doc abo...
# language-evolution
g
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 🙂
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
not Kotlin-specific, but see Bloch's Effective Java book, section "Design and document for inheritance or else prohibit it"
👍 3
🙏 1
m
I believe the Kotlin team was heavily influenced by Effective Java and tried to make Kotlin fix many of those issues.
e
yes, that is my understanding as well - in many ways, Kotlin codifies good Java practices accumulated from Bloch and others
i
There's an explanation from Andrey Breslav, the lead language designer at that time: https://discuss.kotlinlang.org/t/a-bit-about-picking-defaults/1418
g
K Exaclty what i was looking for. Thanks !!!