Kotlin: The Language the Industry Switches to in >5 Years

mvndy
4 min readApr 13, 2018

No one likes the idea of redoing an entire portion of their software in production in a different language. Why switch to Kotlin?

Is it REALLY another language though? Technically speaking, yes. If you take a look at the Kotlin itself, you’ll find that it’s extremely similar to Java and all surrounding frameworks.

Kotlin was created in 2011 by a small JetBrains team in St. Petersburg, Russia. It is a statically typed language that runs on JVM that may compile to JavaScript source code or use the LLVM compiler infrastructure. Since then, it’s grown exponentially in popularity. In 2017, Google officially backed Kotlin as the official language for Android. Frankly, everyone in the community is really excited for the second year’s KotlinConf in Amsterdam. Not only has the community really exploded in literally the past year, but the following companies have put Kotlin into production already:

  • Uber uses Kotlin for building internal tools
  • Gradle introduced Kotlin as their language for writing build scripts
  • Atlassian powers their Trello on Android with Kotlin
  • Pinterest has incorporated Kotlin in their application with an average use of 150M users a month

In my personal experience, I found that I now can code as fast as I can think without having to worry about the idiosyncrasies that might come with Java. Simply put, Java verbosity reduces clarity as the intent of the code is lost in unnecessary syntax. Asides from cleaner code, Kotlin has features and new libraries built by the community every single day that makes doing your job easier. It is interoperable with any existing system or Java libraries, and most importantly, gives the null safety Java risked that allowed programs to crash during runtime (feel free to read NPRs: The Billion Dollar Mistake for null’s impact on our world today).

Last company I worked at was a start up in sales enablement, where the common market is aimed at B2B clients. The industry itself is extremely cutthroat, especially for a small startup a fraction the worth of the competition. In B2B sales-enablement, one competitive strategy involves creating a customized demo for prospective clients. Despite the 4-member team managing 50+ clients, it killed me how we spent an average of 3 hours per demo when I honestly felt it was the same product — just different modules, different colors, different placement. I have a passion for being lazy. Wanting to create a native solution, I stumbled on to Kotlin by accident when I realized how gross drag-and-drop happened to be on JavaFX.

Oracle’s JavaFX example for setOnDragOver()

I leveraged TornadoFX (Kotlin framework for JavaFX) and TilesFX to create a drag-and-drop GUI with the intention to produce source code. That was for the business, but I have an open-source version too.

Edvin Syse’s TornadoFX OSGI Support setOnDrag function

Kotlin is the first open-source community I’ve joined, and it’s been the most rewarding experience I’ve had. If you develop in any form or framework of Java, take a look at what we got. While Kotlin is compatible with existing Java code bases and libraries, Kotlin has a lot of similar solutions created with a much lighter framework (take a look here for the equivalent of anything you’re attached to at the moment). Moreover, there’s a lot of exciting projects ready for anyone to contribute to, and we’re only just getting started.

User growth on Stack Overflow for Scala(green), Kotlin(blue), and Groovy (orange)

̶R̶i̶g̶h̶t̶ ̶n̶o̶w̶,̶ ̶t̶h̶e̶r̶e̶’̶s̶ ̶o̶n̶l̶y̶ ̶2̶0̶ ̶c̶o̶m̶p̶a̶n̶i̶e̶s̶ ̶i̶n̶ ̶t̶h̶e̶ ̶w̶o̶r̶l̶d̶ ̶t̶h̶a̶t̶ ̶h̶a̶s̶ ̶K̶o̶t̶l̶i̶n̶ ̶s̶u̶c̶c̶e̶s̶s̶f̶u̶l̶l̶y̶ ̶o̶n̶ ̶p̶r̶o̶d̶u̶c̶t̶i̶o̶n̶.̶ [Updated: October 22, 2020] In Android, 60% of developers are using Kotlin in the industry. In addition, 70% of the top 1000 Android apps are using Kotlin! Many more are making moves to develop new products AND update legacy code, little by little. Do I think there’s a future in Kotlin? Honestly, what it has right this minute is enough for companies to hop on to the bandwagon, but there are really exciting projects developing as I speak. Heck, if you’re feeling Kotlin too, give it a try and join the community — find us on Twitter, on kotlinlang.org, or take a look at the plethora of resources available for anyone.

Update 6/17/2018: I’ll be speaking at KotlinConf — if you’re not going, please sit in on the amazing talks on Youtube!

--

--

mvndy

software engineer and crocheting enthusiast. co-author of "Programming Android with Kotlin"