What is Kotlin?
The internet is buzzing with articles and programmer discussions about Kotlin, a new, increasingly popular programming language for Android. Where did this budding commercial‐development phenomenon originate? And from a customer’s point of view, what are the pros and cons of app development with Kotlin? This latest article from HireRussians provides answers.
At the Google I/O annual developer conference in May 2017, the Android team announced first‐class support for Kotlin, so it’s reasonable to assume that the number of projects written in Kotlin will increase sevenfold in the coming months. But long before this announcement, many major companies (Amazon Web Services, Square, Pinterest, Uber, Basecamp, and others) had already posted news regarding the partial or complete move of their projects to Kotlin.
So why is Kotlin so popular? And why are more and more developers departing from long‐standing languages like Java, which up until now has been the de facto Android language?
Everything started the day that JetBrains, a company that develops IntelliJ IDEA (IDE for Android) and other common IDE, decided to develop a new Java‐based language that “would incorporate the best aspects of other languages”. Thus Kotlin was born, and today it is used not just for implementing Android, server, and desktop apps (with Kotlin/JVM), but also web services (Kotlin/JS). Moreover, JetBrains promises to make it possible to compile Kotlin code for an iOS/macOS platform (with Kotlin/Native) in the coming months.
Over the course of its meteoric rise to prominence, Kotlin has built a global community of committed developers, all of whom benefit from the language’s top priority: “to help developers with the tedious and mundane tasks, allowing them to focus on what’s truly important”.
Benefits for customers
Programmers are clearly head over heels for Kotlin, but what advantages does Kotlin offer for the end‐customer? Leveraging our 19 years of experience with clients from diverse industries, HireRussians has compiled a list of reasons why you should ask your development team to code your next (or current) app with Kotlin.
#1. Less development man‐hours
The first argument in Kotlin’s favor is its conciseness. Kotlin’s auto‐generation of various boilerplate code decreases the total number of code lines by up to 40%, depending on an app’s specific features.
Here’s a telling comparison we made of the same class coded on Java (62 lines) vs. Kotlin (23 lines):
Kotlin’s conciseness saves experienced developers 10–20% in development time, compared to Java. This is a huge deal for the developer as well as the customer, who reaps the benefits of quicker turnaround time and lower development costs.
#2. Fewer bugs and crashes
Kotlin’s second advantage? The additional code‐checking aids it provides. These aids mean less time, less money, and less headaches related to bugs. Also, as described by the Android team on their site, “It (Kotlin) has wonderful safety features in terms of nullability and immutability” — hence, the app will experience fewer crashes and problems because the developer can neutralize any programming bottlenecks while compiling.
#3. It’s easier to support
Kotlin’s readable syntax is a truly crucial characteristic. Lots of lengthy code constructions are replaced with shorter ones, and the language offers a self‐explanatory syntax.
Here’s an easy‐to‐understand example of making a cup of coffee, as written with Kotlin:
This simple syntax allows all team members (even first‐time Kotlin users) to comprehend the code with little effort. Therefore, Kotlin apps are easier to support and will save you time and money when adding new features/fixing bugs.
#4. It’s a cross‐platform language
JetBrains’ self‐declared goal is to make Kotlin a cross‐platform programming language. In fact, stable releases of Kotlin/JVM and Kotlin/JS already exist, and Kotlin/Native is in rapid development.
What does this mean for customers? Let’s say that in addition to your Android app, your long‐term goal is to implement your idea as a web service and an iOS. If your team has developed a Kotlin app for Android, then all the code related to business logic and data structure may be compiled for the other two platforms. Even though the UI and some other specifics should be developed for each platform separately, Kotlin’s cross‐platform capability is a big plus for customers in terms of time/money savings and overall project cohesiveness.
The idea of using the same code across several platforms and saving countless man‐hours sound great, right? Well, it is — but with a caveat: there are times when you’ll need to develop certain platform‐specific app features independently, in order to avoid any snags. Thus we strongly recommend hiring seasoned, trustworthy experts who can suggest the right technologies to use so that your project runs without a hiccup.
Possible difficulties
Kotlin’s Future
Regarding possible difficulties with Kotlin in the future… we can’t think of one. Even before the Google I/O announcement, Kotlin was already considered one of the world’s best‐supported languages. It also has one of the biggest development teams, which really cares about community members’ suggestions. Post‐Google I/O, JetBrains will& continue with support and development, but now in concert with the Android team.
Should I rewrite my app’s current code in Kotlin?
One of the Android team’s weightiest arguments for making Kotlin an official language is, “It’s interoperable with existing Android languages and runtime. So you can keep your existing code, continue to use the various Android libraries, and incrementally add Kotlin code to your project”. This means Kotlin can be used for your “from scratch” app, or for gradually migrating your current projects from Java when adding new features or bug‐fixing.
How to support a Kotlin project
Although Kotlin code is “easy to read”, for your app support we recommend hiring skilled professionals who are experienced with the language. This will streamline any necessary edits, and to be honest, right now it’s still far easier to find a Java programmer than a Kotlin programmer. That said, the Kotlin community is growing fast, and if you do find skilled, responsible Kotlin developers you’ll be surprised how well the language’s advantages (i.e. conciseness and familiar syntax) facilitate faster bug‐fixing and problem‐solving.
Conclusion
HireRussians’ Android Development team mastered Kotlin a few years ago, so we’ve already assessed this promising language’s convenience and the opportunities it offers in commercial software development. Also, it’s a real pleasure to see a developer with 15 years’ experience rejoicing over the availability of new features and expressive code. Not surprisingly, we highly recommend Kotlin as the language for your next (or current) project, and we endorse the view that it “Makes a huge difference in programmer happiness”.