26 C
Jaipur
Saturday, October 24, 2020

How Kotlin won the language war in Android app development – Latest News

Must read

iPhone 12 Users Can Now Download OS Updates Over 5G Data

Apple finally introduced 5G support with the launch of its latest iPhone 12 series. Now, as iPhones support high-speed 5G networks, the Cupertino tech...

Check Out Oppo Find X2 League of Legends Special Edition Right Here

After much anticipation, Chinese phone maker, Oppo unveiled the second generation of its Find X series, the Oppo Find X2 and Find X2 Pro,...

apple: Apple fixes 6 malicious apps posing as Adobe Flash installers – Latest News

The malicious apps masquerading as Adobe Flash installer are not going to go away anytime soon as Apple has once again fixed six more...

For a project that is less than a decade old, with the first stable version being released just four years ago, the growth of the programming language Kotlin has been exponential. Google helped in this, by announcing its support for use of Kotlin on Android in 2017, and by anointing it as the preferred programming language for Android in 2019.

A July update on the Android Developers Blog says that 70% of the top 1,000 apps in the Play Store use Kotlin. Pinterest, Uber, Evernote, Square, Postmates are among those who have moved to Kotlin.

As larger and more visible companies adopt Kotlin, it will become more attractive for other businesses to consider using it. We want to continue to provide a top-class language with good tooling

Hadi Hariri, Kotlin developer advocate, JetBrains, creator of Kotlin

“Kotlin has become quite popular, especially since it’s been made the language of choice for Android development,” says Hadi Hariri, Kotlin developer advocate at JetBrains. JetBrains is Kotlin’s parent and it is trying to fit Kotlin into the existing multiverse of technologies – data science, web frontend, server-side, native, multiplatform and Android. Hariri describes Kotlin as a “multipurpose industrial language.” But it is Kotlin for Android development that is most popular globally, and especially in India. “In a country like India, where all applications are built mobile-first, with a 90% market share of Android, it’s a no brainer that everybody is writing applications for Android,” says Maneesh Sharma, country manager of software development platform GitHub.

With everybody starting to participate in the code economy, having simple languages really help. That’s why languages like Kotlin, Python and others are simplifying the syntax, making it easy to write code.

Maneesh Sharma, country manager, GitHub

Kotlin was originally conceived as a project to cover the ground that Java could not. Its design ensures ease of use – syntaxes are simpler when compared to Java, yet core functionalities remain intact. Some estimates find it reduces the number of lines of code by 40% compared to Java because you can express more concisely what you want the machine to do. One big advantage is it takes care of what are called null pointer exceptions, which can potentially crash applications and which is an issue in Java programming.

Null pointer exceptions happen during the runtime of the code when variables are assigned no (null) value. “Kotlin is designed in such a way that you can’t write a lot of code that can generate null pointer exceptions,” says Arnav Gupta, cofounder of programming training platform Coding Blocks. The 100% interoperability with Java code is what gave Kotlin the initial momentum. “Existing Java code can be called from Kotlin in a natural way, and Kotlin code can be used from Java rather smoothly as well,” says kotlinlang.org.

When you use Kotlin without Java, it’s faster. But getting there will take time. JetBrains and the entire Kotlin ecosystem are pushing towards building more Kotlin libraries, rather than having to use Java libraries

Arnav Gupta, cofounder, Coding Blocks

The interoperability, added with code features that Java developers always longed for, made some coders dub Kotlin as ‘better Java’, says Gupta.

For those using Java for Android, the interoperability meant a smoother migration. The entire Kotlin ecosystem, Gupta says, has grown using Java as a crutch.

Most of the Kotlin developers are Android developers as well. “They never have to worry in particular about a Java line of code. Their solutions mixed with Java will work in Android,” adds Gupta.

But this version of Kotlin works with Android Runtime (ART), a virtual environment that allows the same code to run on varied platforms. That works beautifully in an Android world where smartphones come in numerous platforms.

One of the main advantages of using Kotlin is the ability to use it along with Java while writing code for an Android app. Developers can write some parts of the code in Java, other parts in Kotlin

Sampathkumar Kuppusamy, Lead – Mobile CoE Practice, UST Global

But iOS and embedded devices require a different approach. That’s where Kotlin/Native comes in. It uses what is called LLVM (low level virtual machine, which is a set of compiler and toolchain technologies) to compile Kotlin code directly into machine readable code. LLVM compilation makes Kotlin/Native faster, but the code cannot have any Java dependencies. “If you want your code to be native for any hardware system, like an IoT device or an Android TV, you will use LLVM.

So far, I haven’t seen many developers in India do that,” says SiddheshPatil, mobile developer at Paytm Insider and organiser of the user group Kotlin Mumbai. Gupta agrees. “There is a lot of learning gap when we talk about Kotlin/Native,” he says.

Kotlin also saves a lot of development time because it allows for substantial code reuse through Kotlin Multiplatform Mobile (KMM). Code written in common Kotlin (be it business logic, infrastructure code, and other functionalities like core libraries, and basic tools) works everywhere.

If developers are making something new, they now do it in Kotlin. If there is legacy code that is in Java, that is being made interoperable with Kotlin. All developers understand that Kotlin is the way to go

Siddhesh Patil, mobile developer at Paytm Insider and Kotlin Mumbai organiser

“KMM helps to share common code across an application that can target multiple mobile platforms (iOS and Android). An application would usually consist of this common code, and then platform specific code which deals with the user interface (UI). By using this approach, we can make sure that applications feel native to the platform, yet at the same time we reuse as much code as possible,” says Hariri. KMM also targets native desktop, JavaScript, and other platforms.

Close to 10% of requirements from companies have been in mobile development, which has been for iOS or Kotlin for Android. We don’t see any demand for Java for mobile app development

Narayan Mahadevan, founder, Bridgelabz

Kotlin is seeing significant action on the server-side too. Hariri says among attendees at the KotlinConf events in recent times, around 40% are server-side developers.

“In the case of the JVM (Java Virtual Machine), you can use a wide variety of server-side technologies and frameworks such as Spring, Micronaut, Quarkus, and even Kotlin-specific frameworks such as Ktor, which is a great solution for building connected systems and microservices,” Hariri says.

Only time will tell if Kotlin becomes this overarching language that’s used everywhere, much like Java. Or it remains primarily in mobile app development.

Source link

- Advertisement -

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article

iPhone 12 Users Can Now Download OS Updates Over 5G Data

Apple finally introduced 5G support with the launch of its latest iPhone 12 series. Now, as iPhones support high-speed 5G networks, the Cupertino tech...

Check Out Oppo Find X2 League of Legends Special Edition Right Here

After much anticipation, Chinese phone maker, Oppo unveiled the second generation of its Find X series, the Oppo Find X2 and Find X2 Pro,...

apple: Apple fixes 6 malicious apps posing as Adobe Flash installers – Latest News

The malicious apps masquerading as Adobe Flash installer are not going to go away anytime soon as Apple has once again fixed six more...

smart speaker: Global smart speaker market to reach 163 million units in 2021: Report – Latest News

Led by Amazon Alexa and Google Assistant powered devices, the global smart speaker market (including smart displays) is set to reach 163 million units...