• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 8857
637
Mac OS X VI Editor BSD Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

reply
    Bookmark Topic Watch Topic
  • New Topic