DEV Community

Discussion on: Scala, Kotlin, or Grovvy? Which Programming language Java Developers Should Learn?

Collapse
 
robotsquidward profile image
A.J. Kueterman

Awesome article! I'm an Android developer that has fully shifted from Java to Kotlin for Android development and I love it! I also do a lot of automation/build stuff in Groovy because Gradle. If I was a Java dev moving to Android I would first try to understand basic Gradle syntax in Groovy then quickly move to Kotlin.

Collapse
 
fultonbrowne profile image
Fulton Browne

I am learning kotlin (also an android developer) any tips?

Collapse
 
robotsquidward profile image
A.J. Kueterman

I was lucky that I started learning Kotlin with a few other developers while we all worked on one large legacy codebase. That gave me the advantage of learning from not only my mistakes, but the mistakes of my peers as we learned how to capitalize on Kotlin.

There are tons of resources for learning Kotlin as a beginner that a quick google will reveal, so I'll stick to some high level stuff that helped me.

Build off what you know. For me, this meant building things on Android because I leaned on my knowledge of the Android APIs to put Kotlin in context. For example, I used to use Interfaces to create callbacks from my RecyclerView adapters back to my Fragments. In Kotlin, I can just pass a lambda argument into my adapter instead. Then it's just applying the syntax and profiting from a big reduction in boiler plate. (I know lambda's aren't Kotlin exclusive, just an example I experienced moving from Java 7).

I would also try to avoid using the Android Studio tool for Kotlin conversion. It does very little to help you understand how Kotlin works or even how you'd normally apply it. However, manual conversions did help me, especially when I challenged myself to use Kotlin language features and eliminate as much Java boiler plate as possible.

Finally, just explore the power of the tools in your code. Moving from Java to Kotlin introduces the concept of null-safety in a really full-featured way. This was novel at first, but when you start using tools like let, run and when to their full potential in concert with nullable types, you unlock some extremely cool stuff. It makes it hard to go back!

Thanks for asking, and good luck!

Thread Thread
 
fultonbrowne profile image
Fulton Browne

Thanks!