Kotlin FAQ - What You Need to Know about this Official Language for Android Development

Photo of Jarek Józefowski

Jarek Józefowski

Updated Apr 19, 2024 • 8 min read
pexels-photo-159240-837720-edited

On 17 May 2017, Google announced their first-class support for Kotlin, which means that Kotlin was built entirely in Kotlin and supported iOS, Android as well as most browsers via its web app.

With the growing support for both major mobile platforms Kotlin is bound to gain in popularity, and its future seems not to be confined only to Android. You might have heard about Kotlin and asked what it is and whether it is worth choosing this technology over Java for Android mobile development. This article was written to provide answers to these questions - and more.

What is Kotlin?

Kotlin is a modern programming language for Android, JVM, Browser, and Native development created by JetBrains. It has the official support of Google, but the Android community has been using the language for app development for years even before the support announcement. Recently, it has received improved support for iOS. We’ve been using Kotlin since 2015 when it was still in beta – have a look at our Kotlin showcase app, CoolCal, and a brief article about how it was developed. Kotlin’s website gives a number of examples of well-known products written in the language, such as Pinterest, Evernote, and Trello.

Why should I even care about Kotlin?

Kotlin is a powerful, modern language with many useful features. It’s very expressive and much more concise than Java. While Java has earned its reputation as a robust and reliable technology, it lacks many features and is slowly becoming obsolete, making Kotlin a great candidate to replace it. Kotlin is very similar to Apple’s Swift in terms of its ideas and goals. The similarities between these two languages will help Android and iOS developers easily switch between development for each platform.

When it comes to strictly technological advantages, Kotlin offers first-class support for functional programming, even though it is mainly object-oriented, making the most out of both paradigms and opening new programming possibilities. Apart from that, JetBrains built protections against errors related to nulls straight into the type system, which makes the language much more fault-proof and thus easier and cheaper to maintain. The creator of null famously said that the null reference must have generated billions of dollars in losses caused by errors, vulnerabilities, and system crashes. Now, you can stop fearing null-related errors and save yourself some money, too.

Apart from Android (and recently also iOS), Kotlin is also great for JVM development, which facilitates building desktop, web, and backend server applications using established Java frameworks such as Spring, Vaadin, Spark, Hadoop etc. On top of that, you can also build statically-typed front-end browser applications with the Kotlin to JavaScript compiler. As a result, you can create Node.js applications using Kotlin! Learning Kotlin will give you a universal tool that you’ll be able to use for all kinds of development.

I already have an Android app – does it change anything?

If you’re currently using Java to develop your Android app, fear no t, because nothing will change. Google will continue to provide great tools and resources to make Java app development easier and faster. You can also add Kotlin to your app without worrying about future support. Check out Google’s official guide on how to get started with Kotlin development for Android.

Should I convert my Java app to Kotlin?

You don’t need to put all your eggs in one basket and pick one or the other. Since Kotlin is 100-percent interoperable with Java, you can incorporate it seamlessly into your existing app, and you won’t even need to rewrite any Java code – just start coding in Kotlin right away!

That said, we would still recommend converting the app to Kotlin for a number of reasons. Being more fault-proof, the app will become easier and cheaper to maintain. Kotlin also facilitates faster development because it is much more concise – rough estimates show that it can cut as much as 40% lines of code compared to Java. Fewer lines of code = less time spent on coding = less money spent on development. Oh, and there’s an automatic Kotlin-to-Java converter, too, which you can find here.

Is there a solid business case for choosing Kotlin over Java?

Most importantly, an app written in Kotlin will be cheaper and easier to develop and maintain – the language will make the codebase more concise and fault-proof, which, in turn, translates into significant savings. Kotlin is also becoming more and more universal, so you will be able to transfer your app from one platform to another if need be. Lastly, the framework is new, efficient, and exciting, which will attract good developers. We’ve already noticed this at Netguru – we’ve been getting lots of really interesting CVs from developers interested in programming in Kotlin.

Can you just give me a brief roundup of Kotlin’s pros and cons?

Sure thing!

Pros:

  • Kotlin is a modern and powerful language – a step forward from Java.
  • As a state-of-the-art technology, it will attract great engineers. You’ll recruit better programmers for Kotlin.
  • Kotlin is 100% compatible with Android thanks to Google’s official support.
  • Kotlin’s great community develops lots of open source projects.
  • Many apps from Google/Android already use Kotlin.
  • You can still have parts of the app written in Java thanks to Kotlin’s full interoperability.
  • You’ll be able to reuse the same logic for Android, iOS, and Web.

Cons:

  • The Kotlin standard library adds about 7K methods and 1MB to the size of your Android APK. However, it could replace some other libraries such as Guava and RxJava that you may be using right now to achieve the same goals.
  • We couldn’t find any more cons…

Thanks for reading! If you have any comments or would like to ask a question about Kotlin, drop us a line!

Photo of Jarek Józefowski

More posts by this author

Jarek Józefowski

We're Netguru!

At Netguru we specialize in designing, building, shipping and scaling beautiful, usable products with blazing-fast efficiency
Let's talk business!

Trusted by: