Out of interest, how many people here are still wr...
# announcements
p
Out of interest, how many people here are still writing their gradle build scripts in Groovy rather than Kotlin ? And why ?
m
Since the internet is full of solutions for Groovy Gradle scripts, it's easier to copy paste them into a Groovy one.
👌 2
b
Familiarity with the Groovy syntax is the main reason. And uncertainty as to whether everything can be done with Kotlin.
d
Personally I think its a bit too soon to change everything to kts files. Needs a bit more time in the oven + most of the examples (which you desparately need with gradle) are in groovy
g
The common flow is: hyped by kts, disappointed by the actual state of development, back to groovy.
6
p
This is my experience also, but I've persevered and all of mine/my company's are in Kotlin now. I think the main issue as people say is a lack of examples. Hopefully this will improve over time, especially in the documentation.
g
no need to make kotlin answer for everything, the idea that typed languages are good for scripting is debatable in itself.
a
My understanding is that a significant amount of gradle snippets out there rely on private implementation of plugin API surfaces that don't port well since groovy will just reflect and call anything
As for typed languages and scripting, I think notable data points include the success of typescript and ongoing python efforts around type annotation
g
@Paul N small thing that seems to worked out for everyone so far is Dependencies/Versions in kotlin in buildSrc. That stuff is actually very convenient and low effort to implement and you've got a handy navigation.
m
Agree with others here. Could write a lot more. Kotlin is close, but personally, I find the benefits of completion overblown. And if you use Idea, and the -all version of Gradle Wrapper, it's reasonably close. Groovy still performs a bit better, but Kotlin is much better than the early days. I'd you're writing code in your build script, there's likely a better way to do it. The groovy syntax is often cleaner because of dynamic nature of language. So for me, I see no reason to use Kotlin, only costs.
As a result, I'd ask the inverse question. Why did people convert their build script to Kotlin? And if they did, what benefits were they hoping for, and what benefits did they actually receive? And what problems did they run into that they weren't aware of going in?