Technology
Potential of Kotlin for server side
2022-6-29
In recent years, Kotlin has been gaining attention as a server-side development language, and while it is most commonly recognized for its use in Android app development, it is also being actively adopted for server-side development by startups and large tech companies ( Adobe, AWS, Expedia, etc.). Kotlin is a versatile programming language that can be used for a wide range of applications, from front-end to server-side development. It supports Kotlin Multiplatform Mobile SDK for both iOS and Android, and can also transpile to JavaScript. At ROUTE06, we are currently testing and introducing server-side Kotlin, and this article will introduce the possibilities of server-side Kotlin.
Google Chooses Kotlin as First-Class
Kotlin is a programming language originally developed by JetBrains, the creators of IntelliJ IDEA, a well-known integrated development environment for the Java language. Kotlin was first introduced in July 2011, then it gained significant attention when Google announced its adoption as a first-class language for Android development at Google I/O 2017. Kotlin is now becoming more widely used in Android development, as it enables the use of a modern programming language in the previously Java-dominated Android development environment, and Kotlin has become a standard feature of Google's integrated development environment, Android Studio, reducing the time and effort required to build a development environment. The trend of increasing Kotlin users can be seen from blogs and repositories that analyze public repositories on GitHub 1.
Kotlin's syntax and description are simpler and more straightforward than Java's, but it is unique in that it runs on the JVM (Java virtual machine) after compilation. ecosystem for many years. Kotlin is also more compatible with Java than other JVM languages, making it easy for existing applications developed in Java to coexist with Kotlin code, such as writing new functionality in Kotlin. Java can execute programs written in Kotlin, and Kotlin can call Java class inheritance and libraries. As mentioned above, Kotlin is a relatively new programming language, yet it is easily accepted by developers with long Java development experience. Kotlin also has a Null Safety specification, which makes it easy to detect the famous null reference errors in Java at an early stage, a point that is highly valued by Java developers.
Google is also actively using Kotlin, and more than 60 applications such as Google Maps, Google Home, Google Play, Google Drive, and Messages are currently implemented in Kotlin. For example, as of June 2020, approximately 30% of the code for Google Home is written in Kotlin, and Kotlin is recommended for all new features. As a result of migrating new feature development to Kotlin, the creation of a certain class required only 23 lines of code in Kotlin compared to 126 lines of manual code in Java (80% code reduction), and the aforementioned Null Safety specification has eliminated the most common cause of app crashes, null reference errors. In addition, the aforementioned Null Safety specification has reduced NullPointerExceptions, the most common cause of app crashes, by 33% 2.
Growing Attention to Kotlin as a Server-Side Language
As mentioned above, while Kotlin is most commonly used in Android application development, its use in server-side development is also attracting attention. As mentioned above, the biggest advantage of Kotlin is its compatibility and interoperability with Java, and domestic and overseas applications that have been developed in Java are now migrating to Kotlin. Overseas, Kotlin is being used by a wide range of companies, from tech companies such as AWS, Adobe, and Atlassian to business companies such as DoorDash, ING, and Expedia. The Kotlin community has positioned JVM support for server-side Kotlin as a priority area in its development roadmap, and it is expected that the benefits in terms of compatibility with the Java ecosystem will be strengthened3.
In particular, server-side development will benefit from the ability to leverage Spring, Java's most well-known framework for web application development, which is one of the most well-known and proven frameworks in the Java community, and is a key component in the development of microservices and serverless architectures. One of the reasons for Spring's popularity among Java developers around the world is its IoC container, which allows for easy Dependency Injection, This feature not only reduces the number of test scenarios by controlling dependencies between code, but also simplifies the code itself, making it easier to ensure maintainability of the entire system. The fact that it is a modern programming language and can easily utilize resources that have been brushed up over the years by developers around the world is also a major attraction of server-side Kotlin4.
Another attraction is the ability to utilize JetBrains' IDE, IntelliJ IDEA, for Kotlin language development. IntelliJ IDEA is used by major companies around the world, including VISA, Samsung, BMW, Twitter, and Expedia. IntelliJ IDEA is used by major companies around the world, including VISA, SAMSUNG, BMW, Twitter, and Expedia, and is the integrated development environment with the overwhelming market share, with three out of four Java developers using IntelliJ IDEA5.
Can Kotlin Become the Successor to Java in System Development for Large Enterprises?
Java is still one of the most widely used programming languages in system development at major Japanese companies and system integrators, and is often used in the development of new applications and services. In fact, it is common for major companies to have check items that assume the use of Java and JVM in RFPs for system development, operation and maintenance, various system testing requirements, security diagnoses, and so on.
In the future, as major companies move toward in-house system development, especially for digital services that require agile refinement of the customer experience, they will need to hire software engineers who are already working at startups and web-based mega-venture companies, and create an environment that allows them to utilize similar skills. and other factors require support for modern programming languages. One of the reasons why major companies, which have been slow to bring systems in-house, are struggling to recruit digital talent is that they are not ready to switch to such a new development environment and to accept such a new system.
In light of this situation, Kotlin is considered to be a reasonable choice as a technology for promoting in-house development and agile development in large companies. Rather than using a different language and technology such as Go or Ruby, Kotlin, which can coexist with current Java resources and has been gaining popularity in recent years, is expected to be more easily accepted by both internal and external parties. Expectations are also high, as the aforementioned Nikkei Shimbun, Inc. is using server-side Kotlin in the development of a platform for authentication, authorization, billing, and settlement of Nikkei IDs6.
ROUTE06 Technology Selection for Smooth Transformation
While Java itself is a programming language that is still evolving at this very moment by the worldwide developer community, it is evolving in a way that it is connected and coexists with Kotlin, which has become increasingly popular in recent years, in a microservices-like manner, while resources and code from both are being merged. The process of digital transformation, which requires the successful utilization of new technologies and conventional infrastructure, may provide useful insights.
ROUTE06 places the highest priority on modern development languages and architectures in the selection of technologies for the software services it develops and operates, with a view to recruiting and training software engineers and improving development efficiency. However, we will continue to make decisions with an eye toward medium- to long-term system collaboration and joint development with existing systems of major companies and development vendors. From the perspective of the further development of enterprise software development in Japan as a whole, we are also focusing on the potential of server-side Kotlin, so we intend to actively disseminate information and conduct educational activities to serve as a link between new technologies such as Kotlin and the development sites of major companies.
About the Author
Takafumi Endo is a graduate of the Graduate School of Information Sciences at Tohoku University. After graduation, he worked at the Development Bank of Japan Inc. and Dream Incubator Inc. He then founded Smarby, Inc., where he served as CEO. After the company's acquisition by a major apparel company through an M&A, he became Director, CPO, and CMO at STRIPE DEPARTMENT CO., LTD. Following his involvement as an EIR at Delight Ventures, Inc., he founded ROUTE06 and became its Representative Director.