I'm a Android developer. As result I use Gradle for build android projects. I write (about 2 years) gradle scripts on Groovy. As result scripts is very compact, clear and easy to support. It is very good.
But in new version of Gradle is introduce new language - Kotlin.
My question is: What is the benefit (for writing Gradle scripts) if I switch from Groovy to Kotlin?
In the future, KTS will be preferred over Groovy for writing Gradle scripts because Kotlin is more readable and offers better compile-time checking and IDE support.
Gradle and Groovy are primarily classified as "Java Build" and "Languages" tools respectively. "Flexibility" is the primary reason why developers consider Gradle over the competitors, whereas "Java platform" was stated as the key factor in picking Groovy. Gradle and Groovy are both open source tools.
To just use Gradle, you can go without understanding Groovy. To understand how a Gradle file syntax works, you definitely need to understand Groovy.
Kotlin is statically typed, whereas Groovy is not. Statically typed languages like Kotlin enable IDEs to support particular tasks much better:
This is a great advantage that Gradle sees and therefore started with Kotlin as an alternative to Groovy.
There are also some official statements which you can find here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With