Let me start this amazing post about basic Kotlin programming by first thanking Google for bringing out this amazing programming language to the developer community.
Years have passed and yet many developers are there who don’t like Java at all maybe because of any reason. For them, Kotlin is here to rock your life.
So let’s start this journey by pondering over the first natural question:
What is Kotlin?
According to Wikipedia.org, Kotlin is a cross-platform, statically typed, general-purpose programming language with type inference. So it basically means, with Kotlin, you can develop applications for multiple platforms like iOS and Android. Kotlin variable types are declared explicitly and we can determine them on the compilation stage.
In other words, Kotlin is an open-source programming language developed mainly for the development of Android Applications and is an alternative to Java.
Kotlin has an improved design as compared to Java and is based on Java Virtual Machine(JVM). We can talk a lot through Java vs Kotlin but Kotlin seems to be a near sister of Java.
Let’s look at what advantages are there with Kotlin one by one. The exhaustive list is compiled by Charles Kincy,
- Inherent null-safety
- Infix operators (which allow easy construction of DSLs)
- Coroutine programming
- Extension methods to allow better object encapsulation on code you don’t own.
- Functions as a first-class object
- Numerous helpful object-functional extensions (like Any.apply)
- Simplified POJO construction via data classes and properties as a first-class object.
- Standard linter for uniform coding style.
You can visit his complete answer at https://www.quora.com/How-does-Kotlin-compare-to-Java
But why Google is supporting Java even with the advent of Kotlin? Primarily, of two reasons:
- While the code of Kotlin is easy as compared to Java and has fewer complexities but the extension methods can break encapsulation and this can lead to other problems.
- Kotlin is not mature and completely reliable as compared to Spring and other frameworks of Java for enterprises involved in medium-scale development.
Yet Kotlin seems to be evergrowing in terms of the number of Android Apps being converted to it on a daily basis and similarly more and more developers are looking to adopt it.
History of Kotlin
Kotlin was developed by a world-renowned IDE producer Jet Brains Inc. in July 2011 under Project Kotlin.
First official release was Kotlin v1.0 on 15 February 2016 and this was the first official stable release.
At Google I/O 2017, Google announced its support for Kotlin.
Google announced that the Kotlin programming language is now its preferred language for Android app developers in May 2019.
Thanks for the read!
For the beginner introduction to Kotlin, please visit : Let’s start Kotlin programming