Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: Switch from Java to Kotlin #779

Open
OndraZizka opened this issue Jan 8, 2024 · 0 comments
Open

Suggestion: Switch from Java to Kotlin #779

OndraZizka opened this issue Jan 8, 2024 · 0 comments

Comments

@OndraZizka
Copy link
Contributor

OndraZizka commented Jan 8, 2024

Hi all,

5 years ago, I have switched from Java to Kotlin, and have been very happy for that since then.
And it is very likely that once you try it, you won't want go back to Java:

  • Kotlin is 100 % runtime compatible with Java (personally, I haven't found any issue on numerous projects),
    both ways - can consume Java libraries, but also the produced artifacts are standard Java JARs.
  • Kotlin is very logical, therefore fast to write in. It prevents several common pitfalls done by Java developers, esp. regarding nullability.
    • It is way simpler to work with collections, use streams, use AutoCloseables, handle nulls, use threads, etc.
  • Kotlin is 90 % readable by a Java developer right away. I have learned Kotlin in around 2 weeks by just finding out the bits that I did not understand.
  • Kotlin's syntax, features, and the standard library, allows a typical Java code to be reduced by around 40 % (my experience), encouraging the developers to refactor, leading to easier tech debt elimination.

Switching to Kotlin is simple, and can be done gradually - Java and Kotlin source code can coexist in the same project, even module.

I offer my experience with Kotlin to port the entire JBake, if there's a consensus.

My motivation is that I would like to develop JBake (once again), but I don't want to spend time on writing all the Java boilerplate.
I have developed a few features for JBake myself few years ago, but then a rewrite came, and I never found time to port them (since the architecture back then required the features to be coded directly into JBake. But with Kotlin, it would be way easier.

Let me know how you like the idea, and I could adjust the build and convert some classes, to give you the idea of how it would look in Kotlin.

If you have doubts, then please comment bellow, why, so that I can have a chance to react and perhaps shed some light on whatever may be unclear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant