Is Java Dead After Kotlin ?

         

Why starting a new Android project with Java is a bad idea:


I’m a programming language sceptic. i.e. I don’t jump on every new language and try to learn five new ones every year. When I find a good one I’ll stick with it. I used Java exclusively as my programming language for 2 year. I did not jump on Kotlin when the cool people did before last year. I explain my reasoning of resisting in this earlier post.
Why and how I switched to Kotlin
I’m one of the very few (judging from my twitter stream) who weren’t jumping up and down out of excitement when Google…
In Smart India Hackathon, we’ve now switched to Kotlin in all of our new project and we’re not looking back. I think we have done the right decision. Kotlin on Android is the future while Java is the past. Let me explain why.


Code quality improves:


While we’re still establishing best practices and patterns on some parts of Kotlin development the language is forcing some very good habits on developers. Null-safety alone improves stability of your projects in most cases.Also, less code, less bugs:

Less code

Less code is never a redeeming feature of a language alone. Readability is always more important than length, or lack thereof, of the code. Always!However, with Kotlin you get both. The language developers keep referring to Kotlin as a concise language. They’re not wrong.


Risk is minimal, Java interop

Kotlin does not lock a project to Kotlin permanently. It is possible to integrate new features built in Java to your codebase in later stages due to the complete Java interop of Kotlin programming language.

Kotlin isn’t a new thing, it’s ready


When Swift was first introduced by Apple it took some time for developers to jump on it. Getting on a completely new programming language is risky. APIs change, tools lack features etc. However, today, no new iOS project will be started with ObjC. Kotlin is not a new language. In fact, Kotlin was introduced before Swift announced by Apple. It is more mature, tested and stable than Swift at this point. It has been possible to build Kotlin apps on Android for years before the official support was introduced last year.

Kotlin and Swift have a lot in common


Good ideas tend to be repeated, copied and imitated. It’s not surprising that the designers of Kotlin and Swift ended up with similar solutions to similar issues.
The benefit of Swift and Kotlin being so similar is that it’s now easy for the iOS team to read Android code and the other way around. Sending over program logic is trivial. You can exchange code between the teams without having to explain details every time.

Tool support is already there


JetBrains have been building Kotlin tools for years. Google’s Android Studio is based on the JetBrains's IntelliJ Idea. After the IO announcement Google and JetBrains are now working together with Android Studio Kotlin tooling. This tooling is based on the long running work JetBrains have been doing in the past years. Unlike when Swift was first introduced on iOS, with Kotlin we’re hitting the ground running. We already have sophisticated refactoring tools, static analysis tools, formatting etc. We can even copy-paste a piece of Java code from Stackoverflow to our project and Android Studio will automagically translate it into Kotlin.. with very high success rate, I may add.

Kotlin is evolving rapidly


JetBrains is very active on pushing new features to the already comprehensive language. New features like Coroutines are enabling new ways to improve your codebase very constantly.

  
Is Java Dead After Kotlin ? Is Java Dead After Kotlin  ? Reviewed by Mr. Strange on June 22, 2019 Rating: 5

No comments:

Powered by Blogger.