Why did Google desire a better platform than Java?
You might be able to guess where I'm going if you clicked on the article. To the cheers of the Android app development community, Google announced their support for Kotlin at the annual I/O developer conference. Where does it leave Java, though? How does it alter the creation of mobile app development ? What initially prompted Google to favour Kotlin over Java?
First of all, despite wishing it could, Google does not plan to eliminate the entire Java ecosystem. However, it has consistently looked for superior programming languages over Java for the creation of Android apps.
It might have begun in 2010 when Oracle, the new owner of Sun Microsystems, sued Google for allegedly stealing the Java API used to create the Android OS. The nine-year-old legal dispute has undergone numerous changes. The fact that APIs were not protected by copyright was the best defence Google had in the case. Oracle, however, argued that they were and that Google had not obtained a licence before accessing the Java API.
This does not imply that if Oracle prevails in the lawsuit, we will lose Android. Because Google avoided a similar problem by utilising the open-sourced JDK in all versions beginning with Android 7.0 (Nougat) (Java Development Kit).
Google has long desired to leave the ecosystem, though. A almost universal programming language is Java. But regardless of how much Android developers loathe or avoid it, Java is still required in some capacity. Because of this, they had to discover something that serves as an alternative to Java rather than its replacement. a language that is both compatible with java and more entertaining to use. So Kotlin was created!
Why did Google select Kotlin as its main language for creating Android apps?
Kotlin isn't a brand-new language that Google has created. JetBrains, a well-known Google development partner, created it as an open-source language back in 2011. But until Google made Kotlin, along with Java and C++, an official language for developing Android apps at its yearly I/O in 2017, it had never received the acclaim it deserved.
Kotlin has been unable to go back since that time. The fact that Kotlin had all the support it needed from the IDE improved the dish even further. This was caused by the fact that JetBrains, the company that created Kotlin, also created IntelliJ, the engine that powers Android Studio.
Because of Google and JetBrains' cooperation and support for Kotlin, Android developers were able to transition smoothly from Java to Kotlin without experiencing any problems. The advantages of Kotlin over Java for Android app development quickly became apparent to Android developers, including some of the following:
- Unlike the verbosity of Java coding, developers could write short, expressive codes.
- The NullPointerException was a common issue with Java for Android app development. In order to solve this problem, Kotlin required developers to explicitly permit variables to be null.
- It can be challenging for developers to switch to new languages, especially if they are accustomed to creating Android apps using the venerable Java language. The Java to Kotlin conversion tool of the Android Studio, which allowed developers to transform Java code directly into Kotlin, was able to solve this problem with ease.
50 percent of Professional Android developers switched to Kotlin and embraced the move as a result of these important advantages and additional ones that followed. According to the findings of Stack Overflow's annual developer surveys in 2018 and 2019—two years in a row—Kotlin is one of the most popular languages used today.
According to the 2018 Stack Overflow Annual Developer Survey, Kotlin was the second most favoured programming language. the StackOverflow website
According to Stack Overflow's annual Developer survey, Kotlin dropped two spots to rank as the fourth most popular programming language of 2019. the StackOverflow website
The cherry on top of this cake was when Google themselves declared that Android development will move to Kotlin first and urged developers to use Kotlin for mobile app development during the Google I/O 2019 conference in May.
The future of Kotlin-based Android app development
By releasing Kotlin and encouraging its use in the creation of Android apps, Google does not want to replace Java. But all it really needs is something to go with the first.
Since Kotlin itself runs on the Java Virtual Machine (JVM), the new programming language wouldn't really matter to end users. As a result, it isn't even fair to compare Kotlin to Java, as has been done recently. Java is Kotlin. Your Kotlin code will run on the JVM regardless of whether it is transformed into Java or not.
However, it is undeniable that Kotlin is one of the programming languages with the greatest growth rates. Kotlin was able to break into the Top 50 Programming languages in the TIOBE index in just six years. This alone demonstrates Kotlin's potential as a creative, useful programming language for creating Android apps.
But will this progress continue indefinitely, or will Kotlin eventually be supplanted by another new language? Such a scenario doesn't appear likely right now. Oracle, though, is aware of Java's importance for developing Android apps and other things. So it shouldn't be difficult for them to ship Java with a few improvements in its upcoming version to compete with Kotlin.
In conclusion, Kotlin became Google's suggested option for developing mobile apps because Google wanted it to! Kotlin was created to outperform Java. It was intended to serve as a stepping stone for businesses that create Android apps to leave Java behind and move to something, ostensibly, better.