Why should use Kotlin for Android app development. Kotlin versions 1.2.70 and 1.2.71

According to Stack Overflow Developer Survey 2018, Kotlin is the second most loved programming language and the fourth most wanted worldwide. Recently, TechBeacon included Kotlin in the list of 5 emerging languages with an excellent future.

Why is Kotlin getting so popular? Why do we use it in our work? Does Kotlin suit for enterprise mobile app development? Why should you choose it for building your Android application? In this article, we’ll answer these and other questions!

Kotlin programming language

Kotlin is a statically-typed programming language, invented by JetBrains, located in San-Petersburg. Being fully compatible with Java, it runs on the JVM (Java Virtual Machine), provides readable syntax, and can be compiled to JavaScript source code.

Famous projects that use Kotlin

For some, it can be a little scary to start custom Android app development in a new language when there are no successful examples of its usage. Though Kotlin is very young, many companies have already written their applications in it.

Pinterest, a popular image-sharing social service, had decided to move away from Java almost once Kotlin first version was released, and presented advantages and disadvantages of using it in 2016, even before Google added an official support for this language.

Coursera, an educational company offering online courses of remarkable international universities, also chose Kotlin. Other examples of using Kotlin in the creation of famous products are Uber, Trello, Basecamp 3, Shadowsocks, Evernote, and Twidere for Twitter.

The invention of Kotlin

Kotlin was created to solve developer challenges of JetBrains company. They needed a simpler tool than Java to work with their main product, called IntelliJ IDEA, totally written in it. The guys investigated the alternatives, stayed unsatisfied, and decided to invent their own language.

The goal was to receive an effective tool that could be used together with Java in custom Android app development, work everywhere where Java can, and replace it if required. So, a big plus is that Kotlin came right from the developer community, not academia.

The development of Kotlin started in 2010. Six years later, in February 2016, we saw the appearance of the first Kotlin version – 1.0. In 2017, at Google I/O annual conference, Kotlin was announced as an official programming language for Android app development.

Noteworthy, that the technology was in alpha testing and then in beta – each for several years – and only then was moved to the production stage. That’s the main reason why everything works as you expect.) However, before the beta even came out, Kotlin programming language had been already used in some Android projects.

Kotlin advantages & why do we so love it

1. Laconism & expressiveness

When the size of a software project is becoming larger, the number of useless code pieces has to be increased just because the syntax of the language doesn’t imply other choices. Kotlin is so loved by developers, and we are not the exception, for its simplicity and expressiveness. It enables to implement various tasks much easier, quicker, and shorter, than the same in Java.

2. Compatibility with Java

Another advantage is that Kotlin programming language is fully compatible with Java. Kotlin developers have access to all Java frameworks and libraries while writing more clear and concise code.

So, Android engineers can use both languages when building a mobile product as well as migrate their applications from Java to Kotlin.

Even if you have a large Java-based project with millions of code lines, you can easily convert it to Kotlin one file at a time and you’ll see everything still successfully compiling. Here in OZiTAG Web Experts, we write our code in Kotlin and use Java only for maintaining old projects.

3. Kotlin enables the multi-platform development

Custom Android app development isn’t the only thing you can use Kotlin for. The technology provides JavaScript support and interoperability, allowing programmers to move their frontends to Kotlin or create the web part in it from the very project beginning.

The founders added Gradle support so that Android engineers can write Gradle files in Kotlin. What’s more, they are actively developing Kotlin Native, which enables to build iOS applications, too. This way, you can write even native applications in this language.

4. Kotlin development provides more safety & less time for building apps

Kotlin founders integrated into the semantics the principles that prevent a wide range of common mistakes generally happening during the program execution. Another reason for Kotlin higher level safety (comparing to Java) lies in its advantages.

It enables the implementation of the same tasks with less time and effort. When the code is more simple and understandable, errors are more difficult to make and much easier to find, so the chances for them significantly decrease. You also reduce the time for mobile app development and bug fixing, which leads to reducing the overall mobile app development cost.

5. Adopting Kotlin is easy and low risk

Kotlin language has readable syntax, it is seamlessly integrated with Android Studio, easy-to-learn, and provides functional programming support. Other useful things and features include extension functions, null safety, better generies, operator overloading, and continuous library size optimizations.

If you want to facilitate the product maintenance or streamline custom Android app development, you can assign two or three engineers to move the project to Kotlin starting from a small part of the code base.

This way, you won’t disrupt the rest of the project while increasing the work efficiency due to spending less time on the development and bug fixing and having a more clear code.

 There are a lot of things missed in Java and fulfilled in Kotlin: Lambda expressions + inline functions, smart casts, extension functions, companion objects, primary constructors, properties, and much more.

In speaking of the most useful features of Kotlin programming language, we asked the head of our Android development department Artem Korolchuk for his expert opinion:
Artem Korolchuk: Like many other Kotlin developers, I believe that the most remarkable features are the following:

  • Null-safety – getting rid of constant NullPointerException is a great thing about Kotlin.
  • Extension-functions – a useful thing allowing programmers to add the functionality to already existing classes. It also enables to make the code more readable and logical, get rid of static Utils-classes, and write your own DSL.
  • Coroutines – concurrent programming is getting more and more simple. It seems that Rx and the ability to simply switch between streams had come to us quite recently. But in Kotlin coroutines made it even much easier.
    Hope, with their help developers, will no longer neglect to perform relatively “heavy” tasks in the background stream, leaving the main one to perform the functions that were originally assigned to it, namely processing, update, and interaction with the UI.
  • There are many other cool things, e.g., functional programming (especially concerning the work with collections), delegates, default and named arguments of functions, inline functions, and a lot more.


Why did we move away from Java to Kotlin

Artem Korolchuk: Unfortunately, Android doesn’t support the ability to use the latest Java versions with all the improvements.
But even if it were possible, Kotlin is the latest-generation language that absorbed a bunch of cool things from other languages. The Kotlin developers have never made a secret of it. Instead, they directly say which features from which languages were borrowed.

Custom Android app development in Kotlin is much more pleasant and convenient. The code becomes cleaner and shorter – with no long heavy constructions. If you wish, you can implement an extension and see how beautiful everything turns out when the conventional 10 lines of Java code turn into 2-3 on Kotlin, while the code readability only increases.

Also, one of the decisive factors of moving away from Java was low risk in adopting Kotlin: you can do it step-by-step as Kotlin is fully compatible with Java and you don’t have to immediately rewrite the entire application.

Many companies are afraid to switch to Kotlin because of possible unforeseen situations and lack of experience. But due to full compatibility with Java, the transition to this wonderful language can be almost painless.

Kotlin versions 1.2.70 & 1.2.71

On September 13, 2018, JetBrains announced the release of Kotlin version 1.2.70, representing a bugfix and tooling update for Kotlin 1.2. In this version, developers introduced the following things:

  • enhancements on an incremental compilation for Kotlin/JS
  • native binaries made with Excelsior JET for the standalone Kotlin programming language compiler
  • new refactorings and inspections to the IntelliJ IDEA plugin
  • fixing of many issues in the compiler and the IDE plugin; performance enhancements
  • a number of kotlin-stdlib-common annotations with @OptionalExpectation

This Kotlin v.1.2.70 also provides compatibility with Android Studio 3.1, 3.2 RC, 3.3 Canary, and all versions of IntelliJ IDEA from 2017.3 to 2018.3.

Just a week ago, we saw the release of Kotlin 1.2.71 that involved improvements to the IDE and other fixes and improvements from the previous version.

If you have some questions about the article, Android development, or have a project idea, contact us and get your free quote! Specializing in building Kotlin applications, we’ll be glad to help you!

This website uses cookies to improve site functionality, to provide you with a better browsing experience and proper advertising. By using this Site or clicking on "OK", you consent to our Privacy Policy