Win a copy of Bad Programming Practices 101 (e-book) this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Kotlin in Action: What topic/concepts in Kotlin are completely different from Java?  RSS feed

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kotlin provides various different features that are not present in Java, what are those? How as a java programmer can think in terms of kotlin?
 
Marshal
Posts: 5802
401
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

Your question appear to be quite wide and that might be for a discussion about the whole language.
Maybe you could narrow it slightly down, so the author would have a more concrete topic to address?

But if author feels to be able to squash that into a singular post - @OP you are lucky then
 
Narendran Sridharan
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hope, every developer in Kotlin has to treat every object to be closed or immutable first and slowly let the mutability to creep in, as per the scope. An obvious shift in the mindset of developers can be achieved in Java or other language developers as well.
Kotlin has taken advantage of being immutable first and seems to have devised various concepts or features around it like "declaration site variance & annotations, type projection", it is not present in java, a java developer like me see it as a completely new concept. It requires a second level mind shift for developers, which my point of view is very difficult to achieve.

Features like value types, pattern matching may / may not come to Java. Current Java developers don't have anything as such. We seem to have data classes in kotlin and pattern matching seems mostly not required with other features.

To my surprise, we have this page, Comparison of Java and Kotlin. I just saw it only after posting the question in JavaRanch. It too does not highlight some features like "Destructuring Declarations", "Sealed Classes", "Type Safe Builders", etc., which look interesting and unfamiliar to Java developer.

Authors can point out such concepts/topics with some advise/suggestions. which could help developers like me to make trampoline jumps and emark on kotlin easily and to pay special attention to such concepts/features/topics.

 
Lasagna is spaghetti flvored cake. Just like this tiny ad:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!