Conducted a small survey on twitter regarding the inheritance related open decorator in the Kotlin language . The comparison was between the design semantics offered via Java's final keyword and Kotlin's open keyword. Here are the results. In Java every class by default is inheritable until made final. In Kotlin every class by default is not inheritable until annotated with the keyword 'open'. If you were to create your own language which approach would you prefer — RajeshPatkar (@RajeshPatkar) November 14, 2017
Popular posts from this blog
Grapes a Metaphor
If I ask Chotu how much time he will take to eat ten grapes, he will typically say a few minutes. If I ask the same question to his digestive system, then the answer maybe a few hours. The answer depends on who is answering and what eating means. For Chotu, it is chewing, gulping, and relishing their taste. Chotu also rejects peduncles, cap stems that come with grapes. For his digestive system, chewing would mean breaking down and converting grapes into its ingredients, and gulping would mean incorporating them in blood, and rejection means excretion of the non-essential. As I see it, eating is of two types Deep and Shallow. Usually, what we call eating is in this context, Shallow Eating, and digestion is Deep Eating. Both are essential for survival. When we intake Knowledge, we go through a similar process. The Shallow Eating part is akin to reading books, watching videos, attending seminars, among other things. The metaphorical grapes have gone inside our...
Why Java Objects only on Heap?
B ackground Last month I had asked a Java related question to all my students on a facebook post . Why is it that in Java, Objects are always to be allocated on heap? Why is dynamic allocation the only option in the toolbox of a Java developer while creating objects? It was a very interesting discussion on facebook. Many participants, my students and otherwise gave good arguments in defense of the Java Language Design. One of the arguments that came out shining, was that of the possibility of unsafe allocations on Stack Frame. Special thanks to Ted Lum, Chetan Parmar, Nishant Verma, Vaibhav Desai, Tusharkumar Thomar, Vimal Sakhiya, Clair Roma Henry, Subham Gadi, Makarand Bhosle, Prasad Kowli and Nirav Kothari for their participation and valuable arguments. Let me now, put forward my perception on why Java Language Designers would have taken such a decision. The following content in this article assumes that the reader is aware of memory models and lif...
Comments