DEV Community

Discussion on: 100 Languages Speedrun: Episode 35: Groovy

Collapse
 
duncte123 profile image
Duncan • Edited

On a high level groovy does not have any issues correct, the languages is actually quite fun to work with.

Just things like def myInt = 1; will compile to Object myInt = 1;. Another thing is that it does not work well with java in the same project, I really had to hack around that.

Kotlin on the other hand works amazingly well with java. The better typing that kotlin has is also great.

Groovy also has a lot of weird stuff like "ls -hal".execute().text just executing shell commands, this feels very sketchy to me.

demonstration of executing console commands

Fun things that groovy has are no returns (you can probably guess how this becomes confusing if you just have a variable at the end of a function)

def aFunction() { "Hello world" }
Enter fullscreen mode Exit fullscreen mode

although kotlin does it better

fun aFunction() = "Hello world"
Enter fullscreen mode Exit fullscreen mode