Kotlin questions


(Steve Cohen) #1

So I’ve finally started to pay attention to Kotlin, which seems to be the wave of the future in Gradle world. I am trying to analyze the costs/benefits of migrating some custom plugins and build scripts to use Kotlin instead of groovy, with which I have a love/hate relationship. On the one hand, the simplified syntax of groovy is kind of cool (no need for semicolons, as in java, etc.). On the other hand, the simplified syntax of groovy hides a multitude of sins - sometimes a statement without parentheses means the same thing as a statement with parentheses, and other times, it means something totally different. It’s like perl on steroids - there’s more than one way to do it - but you better be careful because sometimes things that look similar are very different.

So anyway, I’m trying to determine if the conversion from groovy-based gradle to kotlin-based gradle makes sense for us, but I don’t find the answer to this question. I read with interest http://melix.github.io/blog/2016/05/gradle-kotlin.html but it doesn’t get at my question. My biggest issue with gradle/groovy is that I still don’t have a firm grasp of when some declaration gets evaluated, and attempts to add some functionality that way crash on the shoals of errors. Though I am the gradle expert on my team, I find that I cannot answer questions from teammates successfully.

What I read about Kotlin seems focused primarily on better IDE support and better performance. I have a few gripes with IDE support but no real gripes about performance. My gripes are mainly about the evaluate/compile/run cycles and the inability to predict when errors will fall on what looks like it ought to be a simple change to add some small bit of functionality. In other words, on brittleness of plugins and buildscripts. What, if anything, would a switch to Kotlin gain me?

I’d welcome any links to discussions of this subject.


#2

Let me throw some controversy in here, though not directly related to Gradle:

Also, considering that Gradle moves on to Kolin, does it mean that it will be renamed to Koadle :wink:

SCNR