Hey there guys! We’re making an architecture decision at my company—should we use Groovy or Kotlin for Gradle?
What are the strong and weak points of the Kotlin DSL for Gradle?
01/31/2020, 3:49 PM
IMO, the Kotlin DSL is more readable and easy to adopt, I always had a hard time when working with Groovy. My only complain is that I feel that Intellij is so much slower when working with kotlin but if you just disabled the auto import you should be ok.
01/31/2020, 5:30 PM
the auto completion of kotlin dsl is much faster than it used be, i think currently it's not a big problem. so i use kotlin dsl nearly in all my kotlin project, but if the project is not dominated by kotlin, i still use groovy. notice that some plugins are only works well with groovy, for example, jooq.
Use what your strong language is. If you're used to groovy, do groovy. But if your codebase is java/kotlin, having autocompletion is a real treat.
Also I tend to not rely on generated accessors too much, I have the feeling it somehow "helps" intelliJ run faster
01/31/2020, 11:05 PM
We're in the process of converting all Groovy to Kotlin because Groovy was hard to maintain as complexity grew, the lack of strong types, no completion / validation resulted in too many runtime issues, etc.
02/01/2020, 12:20 PM
Cons for Kotlin build.gradle:
- slower initial build because it has to compile the Gradle file first... This slows you down if you're editing the files
- less examples
- quirky usage of some plugins (jooq as mentioned)
- code completion
- compile time safety