Java or Kotlin Path

(Erhan S) #1

I am trying to understand and get to know Corda for my project (not a school project:)). I have Java background. That’s why I try to follow mainly Java instructions. I don’t know the situation on Kotlin side, but I find issues in Java examples (compile issues-probably coming from previous releases (thanks to support team for quick fixes), incomplete examples) and I see less examples in github. So my questions are:

  • Does Java side lag behind Kotlin during release updates?
  • Are there less features than Kotlin?
  • Does R3 fully commit supporting Java side for future releases?
  • Should I focus on learning Kotlin and take Corda Kotlin path if I seriously think using Corda in a serious production project?

Thanks in advance for your valuable thoughts…

(Stefano Maffullo) #2

I started 1 month ago too coming from a somehow simple Java background (only academic projects, never real work experience), and I think that the Kotlin side is a bit more robust, with robust I mean that there are more examples, more tutorials andì the syntax is better curated.
As far as I know R3 is committing to Java too but Kotlin will be the main language (because it offers many advantages), so I think that they are writing originally in Kotlin and then translate everything to Java, ( but maybe I’m wrong), so it’s clear that the Java side lags a bit behind.
My suggestion is that you should start learning Kotlin, I have the feeling that it will became very popular in the near future, and being an early adopter will get you some advantages.

(Roger Willis) #3

To answer your questions in order:

  1. As we continue to develop the platform in Kotlin, all API implementations will be in Kotlin. We only use Java for examples and tutorials. There’s no lag per se and we will endevour to keep all the tutorials up to date. It’s difficult for us at the moment as the APIs are constantly changing in the run-up to the V1 release on 30 September. After 30 September all versions will be backwards compatible with V1.
  2. Feature-wise, there’s no difference between using Kotlin and Java. You’ll have a nicer experience using Kotlin though as the language is less verbose.
  3. We have neglected Java a little bit recently as we all love Kotlin at R3 :slight_smile: However, going forward the primary language that we write tutorials and examples in will be Java as that’s the language that most developers are familiar with. Of course we will write Kotlin examples but the primary language will be Java.
  4. From a general professional development perspective, I would take the time to learn Kotlin. The week you spend getting up to speed with the language will pay huge dividends in the future. A good analogy for me is; you are given a bicycle but you need to learn how to ride it. Once you do, you can travel much faster than on foot. Why would you forgo that opportunity on the grounds that you don’t have enough time to learn how to ride it or are too stubborn to learn how to ride it or are scared of riding it? By learning Kotlin you will become a more productive developer and you’ll enjoy your job more. I’m no superstar developer and in less than a day I managed to learn enough Kotlin to be productive.

(Mike Hearn) #4

I’m actually doing some work at the moment on polishing the Java API and JavaDocs. We’ve been focused on finding the right high level APIs and abstractions so far, so we didn’t always bother to write two versions of every example. But as Roger says, once we commit to our current API, we’ll have more time to go back and ensure Java is fully polished.

(Erhan S) #5

Thank you for taking time to write, I will consider your thoughts…

(Mike) #6

Take a look at these Kotlin tutorials.