Kotlin as an alternative to Java for a community-developed project?

TLDR

I am developing a game opensource-project in Java (and JME, by the way). I am alone now, but the project is quite large-scale and in the future requires the participation of several developers. I am tormented by the choice: stay in Java or switch to Kotlin?

More details

I know both Kotlin and Java well. I know that Koltin is mature and stable enough, because I work with it in a banking project with a very solid code base and a very high rate of adding new functionality (the case when after 4 years the project is still developing as a startup, although has tons of accumulated legacy).

I am absolutely sure that technically both languages ​​are perfectly suitable for the mentioned game project (the aspect of Kotlin-JME interoperation is not subject of this topic too - it’s all thanks to JME, JME-related part of project is very small). But, the social aspects are worrying.

Less popular than Java. How many developers are ready to write in Kotlin? (from those who are already ready to write in Java under the same conditions)

Orientation to Android and “scripting style” of programming. Kotlin is a pretty powerful language. On the one hand, it’'s convenient to use it as a kind of modernized “Java ++”, generally sticking to strict design. But on the other hand, in Kotlin it’s easy to write “write only” code (that would have been written in scripting languages ​​before Kotlin). And developers who came to programming not from Java / C ++ most likely will use it that way, which is not very suitable for my project.

Well, the opinions of everyone who has something to say are welcome.

already seen some people write in Kotlin, trully you can write in both.

You only need to care if Kotlin will not be replaced by something else again, like Scala / etc was not successfull. (because well, you would need rewrite it, or use dropped language)

But i belive Kotlin will be more popular soon enough. (i wait for it myself)

ps. if you talk about banking, well, they still use A/B/etc languages :laughing:

1 Like

I have worked on projects using Kotlin. My issues with it stem from programmers writing code that quickly becomes unmaintainable due to the many ‘cool’ languages features it has.

The other issue I have is that it is maintained by JetBrains, and there is little IDE support outside of IDEA for it.

For large professional projects I will always stick with Java. There is a large base of programmers who can use it, many tools for it, and wide support. While many tools that apply to Java also apply to Kotlin, there are many situations that come up where things do not work in Kotlin that do in java, many of the same issues that other jvm languages such as Groovy ran into.

Kotlin is neat for small projects, and as a plugin scripting language. But I do not believe that it should replace a solid foundation like Java, which will be kept alive and supported by many major players such as RedHat. With Kotlin there is no such garentee that JetBrains will support it for the next ten years, or allow other companies to support it if JetBrains decides they no longer want to. It is their language and they can do with it what they want for the most part.

Just my two cents, not saying it is bad, just saying that I will not be building enterprises scale software in it.

2 Likes

That is my primary fear :frowning:

I’d make it dependent on the Team and the scope, but:
Why not both? Things that would be a big boilerplate could be written in Kotlin but more complicated and complex classes could stay in java.

That way, a non-Kotlin dev can always understand the “scripts” while the meat where you most likely need the most manpower is still in standard-java.

But then I didn’t use Lombok’s Getters because I am stupid. But those would work perfectly well for all my Entities, e.g.

Not sure what to say other than that I don’t know Kotlin and it’s harder for me to understand than Groovy.

1 Like

This is a question I had to address on my big project, MyWorld - in my case the decision was not between Kotlin & Java but between Groovy & Java. At the end of the day, I chose to develop the core entirely in Java, with Groovy supported for things like plugins and the built-in command console. I’m fond of Groovy, but I chose to develop the core in Java simply because of how well-known it is - it’s very nearly a lingua franca. Groovy is a fantastic language, and I certainly don’t see it ever going away - but it also isn’t nearly as universally known as Java is. It excels in the capacities we use it for, but I’ve never regretted the decision to keep core development in Java.

1 Like

Yes, I’m in the same boat. Java for the core level that must be “perfect”/bullet proof. Groovy scripting for the level that needs to be a little more expressive and is closer to high level game logic.

2 Likes

@danielp, @pspeed, @Darkchaos agree, Kotlin or Groovy for scripting/plugins is ultimate decision for JVM-based applications. My doubts are about Kotlin vs Java in Core part.

2 Likes

Actually, I use Kotlin in big project in a large bank. And it is not one day project. It is 5 years old and still grows and integrates with a lot of another bank’s internal services. Also Google declares Kotlin as primary language for Android. Looks like it’s trusted by big players. But it’s still proprietary… I don’t know…

1 Like

@NikolayPlekhanov
Thanks for info :slight_smile:

Also Google declares Kotlin as primary language for Android

Yes this give me much hope.

but when i seen @tlf30 reply:

With Kotlin there is no such garentee that JetBrains will support it for the next ten years, or allow other companies to support it if JetBrains decides they no longer want to. It is their language and they can do with it what they want for the most part.

this revert my hope. Im glad project with Kotlin works fine, but myself im just afraid to use it. Maybe will do for game modules(scripting/plugins) like you all suggest.

@oxplay2 @tlf30 as I see, Kotlin is under Apache 2.0 license, so it can be easily forked and supported by community if JetBrains does something wrong.

i know new BSD / cc0 assets/projects can be “forked” without issues, not sure about Apache license, i know its good license(since can mix in code without problems), but i never ask anyone if can easly fork projects with it.

But if this is truth, then Google could just take it when hard times come.

I guess, “easiness” to find someone to fork it when hard times come is proportional to the number of code lines written in Kotlin in the world, so…