Kotlin has become Google’s new favorite language and developers cherish it.
source Stack Overflow
Financial services companies, from Fintechs to large banks such as Goldman Sachs and J.P. Morgan, have shown growing interest in the flourishing language. But how can Kotlin become one of the leading programming languages?
What is Kotlin?
In 2011 JetBrains, the firm behind IntelliJ, released the beta of Kotlin. The first official and stable version was later deployed in 2016.
It is intended to be concise, safe and interoperable:
- Concise by reducing the amount of code written.
- Safe by avoiding common errors such as the null pointer exception.
- Interoperable by being fully compatible with the Java Virtual Machine, Android OS and browsers.
Its compatibility with Java environments and Java libraries are keys to Kotlin being seriously considered as an alternative to Java.
It started gaining popularity in May 2017, when Google announced that it would be a supported language for Android development at the same level as Java and C++.
In May 2019, Google announced that Kotlin would be the preferred language for Android developers. This decision ensures the newly born Kotlin a promising future.
So why did Google choose Kotlin over Java and what are the main differences between Kotlin and Java?
Kotlin vs Java in traditional banks
- It is platform-independent: the same Java code can run on any operating system thanks to its virtual machine.
- It is object-oriented, one of the most popular programming paradigms.
It is used by financial institutions such as banks and insurance companies for one major reason: it is more secure than other well-known languages such as C. Java’s system has good prevention against memory corruption for example.
A major difference between Java and Kotlin is the handling of uninitialized objects, the root cause of a famous error called the null pointer exception.
Simply put, uninitialized objects are memory parts in our program that haven’t been filled with data yet. In Java, trying to access this empty memory will result in an error displayed directly to the end-user of a program. In Kotlin however, unless explicitly specified by the programmer, those errors are only seen by the developer writing the program.
Another difference is the concision of the code. In Java, to create an object with one characteristic and basic properties, forty lines of code are necessary. In Kotlin, only five lines are necessary for the same result. Having a compact code results in clearer programs; it reduces the number of programming errors.
Kotlin does not impose a particular philosophy of programming, on the contrary to Java who is significantly object-oriented. At a time where object-oriented programming is challenged, having this choice offers greater flexibility for programmers.
Furthermore, Kotlin is easy to adopt for existing Java programmers thanks to its interoperability. Programmers can write Kotlin files inside their Java code and compile it without any issue. They can even convert Java code to Kotlin code in a single click on IntelliJ.
Those benefits are pushing Kotlin’s growth in popularity, and explain the reasons why Google chose Kotlin for Android development.
However, Kotlin still has a small developer community (26 000 questions on Stackoverflow, against 1 600 000 in Java according to Stackshare). It makes it hard to recruit Kotlin experts today, especially for financial projects where security is essential.
And switching the programming language of an existing project also means training hundreds of developers linked to the project. Otherwise, the project would rapidly become unmaintainable.
These are the remaining hindrances preventing its massive adoption in finance.
Kotlin is already used by traditional banks and financial institutions for some of their projects. Goldman Sachs, Credit Suisse or J.P. Morgan are hiring an increasing number of Kotlin developers.
And Corda, an open-source blockchain platform created by a consortium of around fifty banks and financial companies around the world, is fully written in Kotlin.
Kotlin has not yet replaced Java in major financial institutions. It is still mostly used for new Android development.
However, its first adoption by the US banks leads us to believe that it will become the primary language for banks’ innovative projects.
Banks cannot change their full stack of code, but Fintechs start from scratch. Does it allow Kotlin to be popular amongst them?
In Fintechs, the situation is drastically different. They have no history with Java and have widely opted for Python. This doesn’t mean that Kotlin isn’t used.
Many Fintechs, particularly B2C companies, use phone applications as a primary mean of service. To create an account in Revolut, you must download their mobile application. Using mobile applications means using Kotlin.
Other examples include N26 who converted their banking platform to Kotlin. Or Monese, who used Kotlin to design new functionality in their Android App. And Change, a cryptocurrency platform uses Kotlin for their server side language.
However, Kotlin remains a very young language. And looking at Swift’s evolution shows how tricky it can be for a language to enroot itself in the programming industry.
Swift was only designed for iOS applications. Programmers can use Kotlin to build back-end servers. Pivotal, a 2000 employee company has been using Kotlin for their backend since 2016. Faire.com have their back-end in Kotlin and their website supports more than 300 000 users per month. Kotlin is indeed making its way into back-end development.
The key to the adoption of Kotlin as a replacement of Java lies in Fintechs. Kotlin gives them the opportunity to use the same language for their mobile applications and their backend.
If the growing market of Fintechs starts using Kotlin, it will become one of the top-used programming languages. Kotlin will be to Fintechs what Java is to traditional banks.
And compared to Java, Kotlin is more concise, modern, creates fewer errors and backed-up by two tech giants: Google and JetBrains.
And you, have you had projects in Kotlin? I’d love to hear your opinion about this language!