Thursday, November 7, 2019

Kotlin vs Java - Which language Android Programmers and Beginner Should Learn First?

Ever since Google announced Kotlin as the official language for Android development in Google IO 2017, programmers who want to become an Android Developer are in a dilemma. Now the big questions in front of them are whether they should learn Kotlin or Java? The answer to these questions depends upon your profile. If you are a complete beginner who wants to learn Android development, then my answer is Java, but if you are a Java developer who wants to jump into the lucrative market of Android App development, then my answer is Kotlin. I'll discuss why a beginner Android programmer should start with Java and why Java developer should learn Kotlin in this article.

When I said, beginners should start with Java, you might be thinking what the heck, Kotlin is much more productive, less boilerplate code, and now the official language of Android Development and this guy is suggesting to learn Java, I am not gonna fall for it...

Well, being a Java developer, I may be a little bit biased, but I'll try to explain my reasons why I suggest a beginner Android developer start with Java rather than Kotlin, but if you have already made your mind to learn Java then you can skip this article now and straight go to The Complete Java MasterClass to learn Java in depth.

It's one of the most comprehensive and up-to-date courses to learn Java online. It has recently updated to cover the latest features introduces in Java 9, Java 10 and subsequent releases. If you want to learn Java, that's the course I recommend.

Now, if you haven't made your mind yet, read on.




Start With Java First

The first and foremost thing is Android development is not everything; as a programmer, you may be starting your career with Android development but if you start with a well-established language like Java, you become a part of a more significant Java community and market, which directly means more job opportunities.

The second and more important thing is that there is a massive community of Java programmers, which means you can find answers when you stuck. This is very important because as a beginner you will face a lot of technical problems and you might not know where to head when you held.

When you search Google with a Java problem, you will bound to get answers; the same cannot be said for Kotlin, which is still a new programming language.

There are also more tutorials, books, and courses out there, both free and paid, which can teach you Android development with Java-like this list of Android resources for Java programmers, but there are not many for Kotlin, especially free resources on Android development.

Things will definitely improve over time when more and more programmers will start using Kotlin, but I doubt it can ever touch the popularity and adoption of Java programming language.

That's why I suggest a beginner programmer who wants to become an Android developer to start with Java, rather than Kotlin.

But, that's not a hard and fast rule; if you prefer learning Kotlin rather than Java due to productivity reason and mostly focused on Android development, then you can sure start with Kotlin and Android Kotlin Development Master Class is the right place, to begin with.

Kotlin vs Java - Which language Android Programmers and Beginner Should Learn First?


But, once you know Java, your journey to Kotlin will also be easy and smooth because Kotlin is 100% interoperable with Java. It compiles into Java bytecode and runs on JVM.



Learn Kotlin if You Already Know Java

Now, coming back to the second set of programmers who want to learn Android development, i.e. our fellow Java developers. For them, I think its best to learn Kotlin because it really improves productivity.

A class that takes 50 lines of code in Java can really be written in just one line in Kotlin. It can help you avoid all boilerplate code for you, e.g., you don't need to specify getters and setters, equals(), hashCode() or toString() method. Kotlin can generate all that by itself.

Here is a nice comparison between Kotlin and Java in terms of  productivity and lines of code to write similar stuff:

Kotlin or Java - Which language Android Developers should Learn?

If you don't know, Kotlin was development by JetBrains, the company behind one of the most popular Java IDE, IntelliJ IDEA. They were a Java shop and developing IDEs like IntelliJ IDEA, PyCharm, ReSharper all in Java and built Kotlin to improve their productivity, but at the same time, they cannot rewrite all their code in Kotlin, and that's why they made Kotlin fully interoperable with Java.

Because Kotlin generates Java bytecodes, you can use your favorite Java frameworks and libraries in Kotlin, and your Java friend can also use any Kotlin framework you develop. Even the dominant Java framework like Spring has started supporting Kotlin from Spring 5. If you don't know what's new in Spring 5, check this out.

Even though currently, almost all Android codes, examples, apps are in Java, it will change in the future because Google has declared Kotlin as the official language for Android App Development.

Many companies have already started using Kotlin for their Android app development, and that's the main reason I think Java developers should learn Kotlin in 2019

If you decided to learn Kotlin in 2019, then Kotlin for Java developers course from Udemy is the right place, to begin with. It's a no-nonsense course for Java developers, which will help you to get going with Kotlin in no time.

Kotlin vs Java - Which language Android Developers should Learn?


You don't need to start with things like what is a variable and object as this course has the right pace and depth for Java developers as compared to other beginners Kotlin course for Android development.

If you prefer books, then Kotlin in Action is also not bad. You can learn about all the essential features of Kotlin, like var vs. val, data keyword, and functional programming stuff all by yourself.

That's all about whether Android Developer should learn Kotlin or Java. As I said, if you are a complete beginner who wants to start your career as an Android developer, you better start with Java. You not only get up to speed in no time but as you would have better community support and knowledge of Java will help you a lot in the future. It will also help you to learn Kotlin in the future.

And, if you are Java developer, then you better start learning Kotlin to not only improve your productivity but also help you become part of a lucrative niche of Java developers who know Kotlin, which may give you a competitive edge in the job market.

Other Programming articles you may like:

Thanks for reading this article so far. If you like this article, then please share it with your friends and colleagues. If you have any questions or feedback, then please drop a note.

P. S. - If you are very excited about Kotlin and looking for a free resource to start with then you can also check out this One-hour Kotlin guide for beginners - a free course on Udemy. It's completely free and you just need an Udemy account to enroll in this course.

No comments :

Post a Comment