DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • Java Vs. Kotlin: Which One Will Be the Best in 2019?
  • Oracle NoSQL Database: A Comprehensive Guide for Developers
  • Why You Should Migrate Microservices From Java to Kotlin: Experience and Insights
  • How To Create a Homescreen Widget in Android

Trending

  • Unit Testing Large Codebases: Principles, Practices, and C++ Examples
  • How Kubernetes Cluster Sizing Affects Performance and Cost Efficiency in Cloud Deployments
  • Orchestrating Microservices with Dapr: A Unified Approach
  • How To Introduce a New API Quickly Using Quarkus and ChatGPT
  1. DZone
  2. Coding
  3. Languages
  4. Java vs. Kotlin - Which Language Should Android Developers Start With?

Java vs. Kotlin - Which Language Should Android Developers Start With?

Should new Android developers learn Java, or go straight to Kotlin? This article talks about the usefulness of both languages.

By 
Javin Paul user avatar
Javin Paul
·
Feb. 16, 18 · Opinion
Likes (22)
Comment
Save
Tweet
Share
112.1K Views

Join the DZone community and get the full member experience.

Join For Free

Ever since Google announced Kotlin as the official language for Android development at Google IO in 2017, programmers who want to become Android developers are in a dilemma. The big question in front of them is whether they should learn Kotlin or Java.

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 beginner Android programmers should start with Java and why Java developers should learn Kotlin in this article.

When I say beginners should start with Java, you may 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 learning 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 the reasons why I suggest a beginner Android developer starting with Java rather than Kotlin.

Beginners in Android Development Should Start With Java

The first and foremost thing is that 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 the bigger Java community and market, which directly means more job opportunities.

The second and more important thing is that there is a huge community of Java programmers, which means you can find answers when you are 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 are stuck. When you search Google with a Java problem, you are 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, e.g. 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 start using Kotlin, but I doubt it can ever touch the popularity and adoption of the Java programming language. That's why I suggest a beginner programmer who wants to become an Android developer start with Java, rather than Kotlin.

However, that's not a hard and fast rule; if you prefer learning Kotlin rather than Java due to productivity reasons and are mostly focused on Android development, then you can sure start with Kotlin, and an Android Kotlin Development Master Class is a good place to begin. 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.

Java Programmers Should Learn Kotlin

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

A class which takes 50 lines of code in Java can really be written in just one line in Kotlin. It can help you avoid all boiler-plate code, e.g. you don't need to specify getters and setters, equals(), hashCode() or toString() methods. 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 IDEs, IntelliJ IDEA. They were a Java shop and developing IDEs like IntelliJ IDEA, PyCharm, and ReSharper, all in Java, and built Kotlin to improve their productivity, but at the same time, they cannot rewrite all their code in Kotlin, so that's why they made Kotlin fully interoperable with Java.

Because Kotlin generates Java bytecode, you can use your favorite Java frameworks and libraries in Kotlin and your Java friends can also use any Kotlin framework you develop.

Even a major Java framework like Spring has started supporting Kotlin from Spring 5. If you don't what's new in Spring 5, check this out.

Even though currently, almost all Android code, examples, and 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 2018.

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

You don't need to start with things like what a variable and object are, as this course has the right pace and depth for Java developers as compared to other beginner Kotlin courses 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, e.g. var vs val, data keyword, and functional programming all by yourself.

That's all about whether Android developers should learn Kotlin or Java. As I said, if you are a complete beginner who wants to start your career as Android developer, you'd better start with Java. You will not only get up to speed in no time, but 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.

If you are Java developer, then you'd 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. It's also one of the 3 JVM languages Java developer should learn in 2018 on my list. 

Java (programming language) Kotlin (programming language) Android (robot) dev

Published at DZone with permission of Javin Paul, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Java Vs. Kotlin: Which One Will Be the Best in 2019?
  • Oracle NoSQL Database: A Comprehensive Guide for Developers
  • Why You Should Migrate Microservices From Java to Kotlin: Experience and Insights
  • How To Create a Homescreen Widget in Android

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!