Latest news about Bitcoin and all cryptocurrencies. Your daily crypto news habit.
Kotlin got big when it acquired the backing from the search engine behemoth at Google I/O 2017. It is now the official programming language for Android development besides Java and C++ and #4 most loved languages in the tech world. (Source: StackOverflow)
As one of the most modern, statically-typed, open-source programming languages, Kotlin can run seamlessly on Java Virtual Machine (JVM). It has similarity with Java, JavaScript and C++. So as a developer, if you know these languages, you can get started with Kotlin in a couple of hours.
Initially, when Kotlin was rolled out, most experienced developers started giving it a try. However, since it has been made the official Android language, more students and developers are moving towards Kotlin to build apps.
According to a RedMonk Report -
Around 80% of Developers are using Kotlin to build Android apps. About 31% use it for backend/server-side applications, while another 31% said they used it for SDK/libraries.
JetBrainsâââThe âBrainâ behind Kotlin
Kotlin has been around 2010. JetBrains developed it to solve their own, internal development & productivity challenges. They are a software development company, and their core area of expertise isâââIDEs. The basis of an IDE is a programming language. The first version of Kotlin came out in early 2016. And, since then Kotlin has been witnessing exponential growth.
Why was Kotlin built?
Almost 70% of JetBrainâs products are built with Java. Slowly and gradually the company was getting tired with the old fashioned ways of writing code. With Java, even a fundamental thing like âHello Worldâ would require any developer to write three lines of code whereas modern languages can do this in about three words.
This means more repetitive work. What JetBrains needed was a new language compatible with Java that would translate to adding new features to existing apps without rewriting things from scratch, and that is less code. They tried Scala, but it was not as fast as they wanted it to be.
Thatâs how they built Kotlin.
Developers are gravitating towards Kotlin because itâs making them happier.
If you are into Project Management and Team Communication, chances are you use âBasecampâ. The company has been one of the earliest adopters of Kotlin.
A third of the Android appâs code was Kotlin-based back in May 2016 (itâs now 100% Kotlin). The code is better, users are happier (the ultimate goal for any developer) and so are the programmers. Whatâs going on, you might ask?
Dan Kim, the android guy at BaseCamp, found himself uttering âholy-shitâ quite a few times when he started writing code using Kotlin.
A popup adapter was his first Kotlin class. He completed it in 86 lines. The code was concise, readable and more importantly, he had fun writing it. Less was, indeed, More.
Next, while converting an existing helper class, he just reduced 94 lines of code.
He had just fallen in love with a programming language and as a developer myself, I can tell you how hard it is to love a language.
Here are some of his favourite Kotlin features which they regularly use at Basecamp.
Some of my favorite Kotlin features (that we use a lot in Basecamp)
Interestingly, he also shares how Kotlin has made him a happy programmer.
As developers, we want to use frameworks/languages to come up with creative solutions to business problems than just cranking up some boilerplate code.
Hereâs how he puts it -
Writing code thatâs concise, clear, and expressive makes me happy. Focusing on creative solutions to business problems, not boilerplate and ceremony, makes me happy. Feeling an intense motivation to learn, which was missing in the Java days, makes me happy.
And thatâs super important. Because being happy isnât just good for the soul. Itâs great for your programming skills too.
The more capable and friendly your language is, the happier you are. The happier you are, the better code choices you make. The better code choices you make, the better habits you build. And the better habits you build, the better programmer you become!
This is exactly whatâs happened with Kotlin and me over the past year. And Iâm a better programmer because of it.
Read more about his thoughts on Kotlin here.
Christina Lee is an Android Engineer, and she was one of the first, few people at Pinterest to try Kotlin for the video pin feature. She says, âworking with it will bring a smile on your face.â
Any organization/company that has been using Java for years can quickly find itself in a quagmireâââwhether to continue using Java or try Kotlin? Because Java can do everything that Kotlin can. Millions of apps, today, are still baked with Java and continue to function well.
The difference is that Kotlin speeds up the development. How?
With more straightforward and easier to read code. No more using that boilerplate code.
Kotlin sure has a more beautiful syntax, but itâs not about the features and functionalities any more. These features ensure that you have a more productive development environment.
The Kotlin-based feature was introduced to approx. 150M users a month.
Similar to Danâs views, Christina opines that â
Kotlin is not a radical departure from Java, as both produce bytecode for the JVM. But what makes it so nice to work with is that it is essentially a version of Java where best programming practices have been built into the language, so it is much easier to do the right thing than it is to do the wrong thing. This allows a developer to code with speed and confidence and removes much of the rote work that had been required while using Java.
Because coding, like writing, is an expressive art form, having a tool like this that allows you to express your thoughts clearly, quickly, and accurately is a satisfying phenomenon and one worth getting excited about. When you combine this with the industry-leading tooling and interoperability of the language and the thorough and thoughtful language leadership displayed by the team at JetBrains, it was difficult not to fall in love with it.
Listen to her thoughts here -
Kotlin at Pinterest with Christina Lee
Caviar app, the on-demand food delivery app owned by Square is also 100% Kotlin-based.
SourceâââVia Google Play Store
When Valeriy Ovechkin joined the Caviar team as a software engineer, the app was 100% Java. He started experimenting with Kotlin as a âpassion projectâ and pitched to the âSquareâ team that it will make the development faster.
When the existing features were rewritten in Kotlin, there was no significant impact on the end-users. But for developers, it was a game-changer.
With Java, coding can be slow, and results can be clunky at times.
Valeriy, gradually, started writing the new features in Kotlin because itâs easier to learn and makes the whole experience delightful. Writing fewer lines of code is what makes developers stick around.
âWhat is interesting with Kotlin is basically it leverages the existing skills of Java developers and finds the right tradeoffs to provide new features and provide things that make Java developers more efficient without going too far,ââââPivotal engineer SĂ©bastien Deleuze
According to Ovechkin, the code (for Caviarâs Android version) is smaller by 15â25%. Thatâs becauseâââKotlin allows you to write concise, smaller amounts of code which results in easier management. Developers can focus on more significant problems than routine tasks.
From Uber to Atlassian, biggies across the globe are using Kotlin to power their apps, back-end etc. Its usage will only grow in 2019.
Why a 100% Kotlin-based Android App is the best bet for your business?
- Low RiskâââStart small by rewriting an existing feature of your app and see how it goes. Have it as a side project and see how your users react. This means your entire product does not need to invest much in the beginning. It is possible because Kotlin classes export a Java API which is similar to Java code.
- Active support communityâââKotlin is backed by Google and has become the official language for developing Android apps. There are tons of resources, talks and community help available to solve your queries regarding anything you feel stuck at.
- Open sourceâââYou donât need to purchase Kotlin. Itâs freely available. If you know Java and C++, you can quickly develop your MVP and start testing your idea before investing full-fledged. You can crank out the best MVP within limited time and budget.
- Efficient teamsâââWhen your team has to code less, it becomes more productive. Use their time efficiently to work on bigger, better issues than just code usual, routine stuff. It saves their time. It helps them work faster and better.
- Easy on maintenanceâââLess code, less maintenance, fewer nightmares. Additionally, there are tons of IDEs available for your developers, let them choose the SDK/toolkit of their liking.
- Compatible with previous versionsâââAsk any Android developer, and youâll know the pain point I am talking about. Kotlin is 100% backwards compatible.
- No more memory leaksâââThe last thing you would want on your app is impaired performance. Kotlin helps avoid memory leaks.
- Interoperability with JavaâââOld projects working on Java? Never mind. Continue working on them with Kotlin.
Ending Notes
We strongly suggest you start using Kotlin for your android apps. At Solutelabs, we too have shifted from Java to Kotlin for building products for our clients, and they have been more than happy with the result. Start taking small steps today to reap big benefits tomorrow.
Cheers!
Musings: What the tech world saw in Kotlin was originally published in Hacker Noon on Medium, where people are continuing the conversation by highlighting and responding to this story.
Disclaimer
The views and opinions expressed in this article are solely those of the authors and do not reflect the views of Bitcoin Insider. Every investment and trading move involves risk - this is especially true for cryptocurrencies given their volatility. We strongly advise our readers to conduct their own research when making a decision.