Add Kotlin as an additional programming language next to Java?
I'd like to propose adding Kotlin as an additional programming language for TripleA next to Java.
If you wanto to get an impression, have a look at the Stochastic Battle Calculator Pull Request.
The next section will be a collection of pros and cons. I put it into a section of its own so everybody can edit it without having to handle this introduction.
Very productive; concise code
Discussing particular language features is better done at other places of the internet.
Worth mentioning in the TripleA context is that in Kotlin you can say more in less code while keeping the same precision (e.g. typing) and quality of code as in Java & lombok (e.g. getter/setter; null-pointer safety). Additionally Kotlin supports some design patterns better, e.g. delegation, coroutines, and inversion of control (providing very concise lambda syntax). This can increase developer productivity which would be very welcome in TripleA.
May attract developers
While Kotlin programs that display the whole strength of the language read quite differently to Java, it is still quite easy to learn Kotlin when you know Java. Kotlin is a modern programming language and may attract developers who want to add “co-developed a complex system in Kotlin” to their resume.
Less comprehensible for pure Java developers
In order to understand what’s going on in the TripleA software, you have to trace through the code.
A Java developer will have more difficulties comprehending Kotlin code than Java code.
The number of enthusiastic Java developers on TripleA is not so lush at the moment. The first contributions in Kotlin come from just one developer. The number of developers who feel easy maintaining Kotlin code in TripleA might be too small (i.e. zero; esp. if the one leaves).
While it is technically possible to convert Kotlin code into Java code (Kotlin->byte code->Java), the result is hard to read and no basis for further development in Java. A developer who wants to add to Kotlin program code either has to do that in Kotlin or has to recode the whole functionality in Java.
@rainova The biggest downside is the maintenance as there are very few developers contributing to TripleA right now and Java is a much more popular language than Kotlin. Overall multiple languages in the project adds complexity to maintain it. If you contribute some Kotlin code and then walk away there is potentially no one to maintain it if there is a bug or someone wants to enhance something around it.
@redrum True. This is only sustainable with more than one Kotlin developer.
@redrum I'm in agreement. Multiple languages increases the complexity especially with future development. It's been a challenge enough learning this code base to understand what can be changed to avoid major impacts.