Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Kotlin in Action: Usage and advantage?

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all!

For the last 2 years I worked on different Java projects in three different companies. Java is one of the most popular language today and yet I increasingly wonder about expanding my area of competence. In my opinion latest Java release was unfortunate. On Ukrainian forums (I'm living in Ukraine) people talk about migrating their projects from Java to Kotlin. They say Java lacks many useful features and we can't hope it will support these features in the foreseeable future.

Ok, I don't mind. Especially since Google claimed its support. The question is: where Kotlin is the best? I suppose, I can write almost any application with it. But what are its exact benefits? Where it fits better than any other language? What area of development is preferable?
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome!

Alex Shykhman wrote:In my opinion latest Java release was unfortunate.


In what way do you think it was unfortunate?

Alex Shykhman wrote:They say Java lacks many useful features and we can't hope it will support these features in the foreseeable future.


The design philosophy for Java has always been that it should be practical and easy to use, and also conservative. Formerly Sun, and now Oracle, are not trying out wild new experiments with the Java language. Especially since it is used to widely (Java is probably the #1 most used programming language around the world) it's important that Oracle is extremely careful with introducing new features to the language, because it's super important to keep everything backwards compatible. When you add a new feature to the language, you have to be extremely careful, because you cannot change it afterwards.

Some other (newer) languages have a different philosophy. For example in Scala, there are often breaking changes from one version to the next, and the designers of Scala are even redesigning parts of the standard library in new versions in incompatible ways. That's inconceivable for Java, because so many millions of lines of code have been written in the past, that must remain working on new versions.

Besides that, I definitely recommend that you learn more languages than just Java. I've looked a bit at Kotlin myself and it's a very interesting language with useful features that are unlike anything that Java has. Learning a new language will expand your horizon and teach you things that you haven't even imagined when you were programming in Java.

Alex Shykhman wrote:On Ukrainian forums (I'm living in Ukraine) people talk about migrating their projects from Java to Kotlin.

Ok, I don't mind. Especially since Google claimed its support. The question is: where Kotlin is the best? I suppose, I can write almost any application with it. But what are its exact benefits? Where it fits better than any other language? What area of development is preferable?


It's indeed officially adopted by Google, mainly for programming Android apps. But also well-known Java enterprise software frameworks, such as the Spring Framework, are officially supporting Kotlin in Spring Framework 5.0. I have not seen many companies yet adopting Kotlin for server-side business software, but that is also because Kotlin is still quite new and companies don't easily switch programming languages - it's already hard enough for many companies to find good Java developers, so they would only be making it even harder to find good programmers if they would start using a new language that not yet many people have learned.
 
Bartender
Posts: 3225
34
IntelliJ IDE Oracle Spring Chrome Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its really interesting to know what led to Google supporting Kotlin officially. Is it because of the recent issues they ran into with Java, that they wanted to adopt an alternative as well?

The fact that it has been adopted by Google over other languages available like Groovy, Scala might have something strong in favour of Kotlin. Do you know of anything in Kotlin that stands out?

Or maybe because its being developed by JetBrains who have a very vast experience in Java and JVM world that they know what didn't work well or what is missing in Java.
 
Alex Shykhman
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Jesper de Jong wrote:
In what way do you think it was unfortunate?


I mean Jigsaw in the first place. Reflection usage was cut, Maven builds now require additional instructions which sometimes weren't clear, many 3-party libs stopped working. If they are no longer supported, then they should be replaced with something. Java 9 introduces completely new, different approach. Sometimes it causes troubles.
 
Mohamed Sanaulla
Bartender
Posts: 3225
34
IntelliJ IDE Oracle Spring Chrome Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Besides that, I definitely recommend that you learn more languages than just Java. I've looked a bit at Kotlin myself and it's a very interesting language with useful features that are unlike anything that Java has. Learning a new language will expand your horizon and teach you things that you haven't even imagined when you were programming in Java.


The last language I tried out on JVM was Scala. And the complexity of the language made it really hard for me to understand the functional programming aspects. But then the same in Java 8 made it quite easy for me to understand the functional programming aspects. But I think I will give Kotlin a serious try due to its adoption in Spring 5.
 
Mohamed Sanaulla
Bartender
Posts: 3225
34
IntelliJ IDE Oracle Spring Chrome Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Alex Shykhman wrote:

Jesper de Jong wrote:
In what way do you think it was unfortunate?


I mean Jigsaw in the first place. Reflection usage was cut, Maven builds now require additional instructions which sometimes weren't clear, many 3-party libs stopped working. If they are no longer supported, then they should be replaced with something. Java 9 introduces completely new, different approach. Sometimes it causes troubles.


No, reflection is still supported. You have to check the new command line options which have been introduced to support deep reflection which libraries like hibernate do. This support introduced is a temporary one to provide time for all the libraries to fix themselves.

And I find nothing complicated in the maven instructions, I guess a few new tags to add which modules it depends and that's it. So you can use non-modular jars as automatic modules in your modular application and they work just fine!!!
 
Alex Shykhman
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Mohamed Sanaulla wrote:
No, reflection is still supported. You have to check the new command line options which have been introduced to support deep reflection which libraries like hibernate do. This support introduced is a temporary one to provide time for all the libraries to fix themselves.

And I find nothing complicated in the maven instructions, I guess a few new tags to add which modules it depends and that's it. So you can use non-modular jars as automatic modules in your modular application and they work just fine!!!


I don't say any of this idoesn't work. I just say, that new Java is significantly different. For instance, if you have old massive legacy project and your customer wants everything up to date, including Java version, migration may be very painful.
 
I'm not dead! I feel happy! I'd like to go for a walk! I'll even read a tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!