What is Kotlin and Why Do Mobile App Developers Love It?

In the world of mobile development, things are always changing. This shouldn’t come as a surprise given the fact that technology is constantly evolving, just like the expectations and needs of end customers. One of the more recent significant shifts refers to the surge in Kotlin development.

In May 2019, Google announced that Kotlin is now the preferred programming language for Android app developers. The main benefit of Kotlin stated in the announcement lies in its conciseness: indeed, Kotlin requires less code - both in terms of typing, testing, and maintaining.

Google’s announcement was not unexpected. Two years earlier, the company announced their first-class support for Kotlin, which overthrew Java as the favorite android development language - off its throne.

Although it is primarily focused on Android, Kotlin aims to be the go-to programming language for multiple platforms - iOS included. In fact, the official app of KotlinConf 2017 was built in Kotlin and it was supported on both desktop (via the web app) and both major mobile platforms (iOS and Android).

But let’s take a closer look at Kotlin and the reasons behind its growing popularity.

What is Kotlin?

superkotlin

Kotlin is an open source programming language with cross-platform and statically typed inference. Kotlin first appeared in 2011, but it didn’t get much attention in the first five years. It was created by JetBrains.

Dmitry Jemerov, JetBrains’ Development Lead, explained how Kotlin was made because none of the existing JVM languages, except Scala, had the right features. However, as Jemerov pointed out, Scala too had its deficiencies, such as its very slow compilation.

If you enjoy fun trivia, here’s one interesting fact: the name Kotlin comes from Kotlin Island, near St. Petersburg. Kotlin’s Lead Language Designer Andrey Breslav said the team decided to name the language after an island, just like Java (even though Java was actually named after Java coffee from the Indonesian island of the same name).

Kotlin finally entered the public eye in 2017 after Google announced its support.

Since then, Kotlin’s adoption has been on a steady rise. The most recent StackOverflow survey showed that 72% of surveyed developers simply love Kotlin. Let’s now examine the reasons why.

1. Interoperability With Java Code

JetBrains made a valid point when comparing programming languages to human ones: the more people speak a language, the better. And what better way to achieve this than using the foundation of already familiar languages to build a new one, right?

The interoperability with Java code is one of the main reasons why developers love Kotlin.

Even though the syntax of the language is not compatible with Java, Kotlin is designed to interoperate fully with it. This means that your existing codebase written in Java can interact properly with Kotlin, and vice versa. In the IDE, there is even a built-in automated Java-to-Kotlin converter. Making it consistent with Java’s frameworks and tools was very smart when you think about the adoption process and the implied risks of code migration.

Kotlin addressed a series of Java issues (e.g. no raw types, null references are controlled by the type system, Kotlin does not have checked exceptions), which for sure made the language tempting for developers.

In addition, compared to Java, Kotlin is much safer. Take nulls in Java for example, which are very error-prone. In Kotlin, by default - nulls don’t even exist..

2. Mild Learning Curve and Open source

celebrate

Since 2012, Kotlin has been an open source programming language and it is continuously improved. The language had its stable release on 3 March, 2020. Developers can enjoy great support from the Kotlin community, which is definitely a plus.

Needless to say, Kotlin has supreme IDE support. All major Java IDEs provide support: NetBeans, IntelliJ IDEA, Eclipse, and Android Studio.

Kotlin itself is easy to learn and very user-friendly, it has an intuitive syntax, just like most of the Java compatible programming languages. In fact, it was inspired by languages such as Java, C#, JavaScript, Scala and Groovy.

Because of the syntax, code written in Kotlin can be easily reviewed even by someone who is not a high level expert.

3. Less Coding Required

If there’s one thing developers appreciate, it’s optimizing their code writing process and avoiding repetition wherever possible. This is another reason why Kotlin is so loved: it eliminates redundant code.

Kotlin is known for being compact and concise. When you need less time to code, you’re consequently achieving faster time to market. Overall, the development process becomes more efficient, costs get reduced, and developers enjoy more creative freedom.

Compared to Java, developing with Kotlin can result in cca. 40% cut in the number of lines of code. Tie that to the fact Kotlin emerged from the industry, not academia - and you’ll end up with a pretty sweet programming language developers are naturally attracted to.

4. Multiplatform Development

multitask

One of Kotlin’s biggest advantages is its multiplatform development. Kotlin can be used for any type of development: from server-side and client-side web to Android and iOS. The language runs on JVM, which enables code sharing between different platforms. Similar to React Native, it offers developers a great perk of reusing existing codes, which saves them a lot of time and energy.

Kotlin/Native is also ready for production development, which is great news. Kotlin/Native is known for balancing between safety and access through constraints. This is how the runtime verifies the concurrent access is safe.

The language has shown a good maturity level and even before its official public release, it’s been used by app development companies. Plus, many reputable companies across different industries used Kotlin for their app development. From Pinterest and Coursera to Trello and Evernote - there are plenty of great examples and success stories.

5. Flexibility And Great Coding Experience

Another great thing about Kotlin is that it provides developers with the freedom to work in their chosen style. It is a highly flexible language that has both object-oriented and functional constructs. Developers can choose the style they like or even mix different styles for the best coding experience. Just a reminder - Kotlin has first-class support. This makes the coding experience even better.

Another advantage of Kotlin as a programming language lies in the fact it solves real-time issues during the coding process. We already mentioned there are no Null Pointer Exceptions, which means Kotlin has managed to tackle an entire class of errors.

When it comes to tools on the JVM side, the main build tools that support Kotlin include Maven, Kobalt, Ant, and Gradle. All in all, Kotlin makes a lot of things simpler.

Over to You

Thank you for reading this article about Kotlin from top to bottom! We hope you learned something new about this programming language and why it’s so favorized in the community of mobile developers.

Currently, mobile apps account for over 80% of all time spent consuming digital media. This is why the rise in mobile app development is fairly logical. At Share IT, we use Kotlin as one of our mobile app development programmatic languages, along with React Native and a few others.

If you’re a developer looking to learn more about Kotlin, check out our fourth suggestion from this list of great quality android app courses.

If you run a business and are seeking for a reliable partner to help you build a mobile app in Kotlin or some other language, reach out to Share IT today. We can help you come up with a most cost-effective solution that will ensure an amazing experience for your end users