DEV Community

Discussion on: Kotlin - Is it time to switch from Java?

Collapse
 
lalunamel profile image
Cody Sehl

I've been using Kotlin in Android development since before it was officially supported and I've loved it.

If you and your team are willing to take the time to learn a new language, then I'd say why not?

The features of Kotlin that I enjoy:

  • A Strong Type System
  • Null Safety
  • Functional Constructs

Those features come together to produce a language that moves a majority of errors from runtime to compiletime (functional constructs don't do that, but I do enjoy using them nonetheless). That, in my book, is why Kotlin is better than Java.

It's fully supported by Android Studio. I've never had any major issues using it. It does get updated quite frequently, though, and that upgrade process can get a bit tricky. Just make sure you commit first, do the upgrade, then commit after.

The Android APIs haven't caught up to Kotlin and I don't expect them to any time soon, if ever. Most Android APIs rely on returning null (tends to be a bad practice in Kotlin) and none use functional programming concepts. That's okay though - the interop is very easy. Using Kotlin on a Java project requires no extra work - just start making classes in Kotlin instead of Java. It's very simple!

It also has great documentation!
I didn't learn Kotlin through tutorials or videos - I just learned by writing a few simple programs and looking up information when I got stuck. If you'd like to learn about Kotlin's functional programming constructs, take a look at the Kotlin Koans

Best of luck!