Does Kotlin popularity increase code quality better than Java?

- Advertisment -

Google announced on I/O 2017 that Android has added support for the Kotlin programming language. Today, in all open source Android applications, we can see that 12% is developed by Kotlin. At the end of 2017, Google said that Kotlin has penetrated more than 17% of Android apps developed using IDE, Android Studio 3.0.

Kotlin is a statically typed programming language that runs on a Java virtual machine and was open sourced in 2012 with an Apache 2.0 license. It is not compatible with Java’s syntax, but is designed to be interoperable with Java code, reuse existing Java class libraries, and is considered to require less code, while less code usually means fewer bugs. Google’s then released Android Studio 3.0 added Kotlin support.

A year later, computer scientists Bruno Gois Mateus and Matias Martinez of Valenciennes University in France published a paper entitled “An Empirical Study on Quality of Android Applications written in Kotlin language” to study the quality of Android applications written in Kotlin.

Original paper: https://arxiv.org/pdf/1808.00025.pdf

In their paper, they describe how to collect 925 applications from the open source app store F-Droid, and how to measure the performance of Kotlin code in each application, and analyze the code “smells” as a measure of code quality.

Note: “Smells” is another term for “anti-patterns”, a term used to refer to poor coding patterns. In Java, The Blob (aka God Objects) represents a commonly cited anti-pattern.

By analyzing the 925 applications, it was found that at least one version of 109 applications was written in the Kotlin language, and 35% of the applications only used the Kotlin language. In applications that include Java code and Kotlin code, the Kotlin code ratio increases and the Java code decreases in more recent versions.

Then analyze the code quality:

Object-oriented (OO) anti-patterns include Blob Class (BLOB), Swiss Army Knife (SAK), Long Method (LM), and Complex Class (CC).

Android anti-mode includes Heavy Broadcast Receiver (HBR), Heavy AsyncTask (HAS), Heavy Service Start (HSS), Initial OnDraw (Init OnDraw, IOD), no memory resolution No Low Memory Resolver (NLMR) and UI Overdraw (UIO).

In object-oriented anti-patterns, LM, CC, and BLOB appear in at least 92% of Kotlin and Java applications, with OO “odor” being more common in Kotlin applications. But the researchers found that in this Android “odor”, Java is more susceptible to three “odors” than Kotlin.

affected applications by smell

Researchers have also mentioned in the paper that the adoption of Kotlin has improved the quality of at least 50% of Android apps. Therefore, Kotlin’s code is considered to be of higher quality.

In addition, the two researchers also compared the Objective-C application and the Swift application and found that the Android application’s outliers are higher than the iOS application.

 

Sarbasish Basuhttps://www.how2shout.com/
From B.Tech (Hons.) Electronics & Instrumentation Engineer to Photography and Writing blogs; he ultimately has answers to everything. Oh, and he's also quite good in rapidly building a relationship and set up the trust; his articles are proof of that...

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Latest Posts

MagTapp app – Improve your vocabulary on Android while browsing web

Improve your English vocabulary and word meanings right on the web browser while ready different articles using...

Best 5 Free Apps to Create Bootable USB drives in 2020

Do you need to install an operating system in your Computer? Then quickly grab a CD or DVD and...

5 Best Free + Paid URL shortening services for Beginners

More or less most of us have heard about short links, which can be used to put off long,...

Top 8 apps that you should download on Amazon Fire TV Stick (India)

The Amazon Fire TV Stick is one of the finest streaming devices available in the market and is also...
- Advertisement -

Corsair iCUE 220T RGB Airflow Mid Tower Smart Case Review

Corsair is one of the prominent name in the computer peripheral industry and especially for RGB...

TEAMGROUP T-FORCE Releases Mirror Design XTREEM ARGB RAM

In Taipei, a gaming brand TEAMGROUP has announced its mirror design T-FORCE XTREEM ARGB Gaming Memory modules to add...
- Advertisement -

You might also likeRELATED
Recommended to you