Why I still love Groovy after all these years
I first came across Groovy around 2010. Java felt stuck at that point, with not much going on. I loved Groovy flexibility and the fact that I didn’t have to use semicolons. I loved using “each” to loop over a list and there was a little library called GPars that made concurrency a breeze.
I joined a startup in 2012 and we built our application on Grails. It was all Groovy and I loved it. It felt productive and I could always go back to writing Java, as Groovy and Java code are fully interoperable.
Groovy lost a bit of momentum over the years, with their core developers moving to other things. But I still like it and it is still my preferred programming language.
Groovy became an Apache project, and they released version 4 a while ago. They face competition from Kotlin in particular, which is now the cool “non-Java” JVM language.
But you can still use Groovy anywhere you use Java. It is fully supported by IDEs like IntelliJ, and frameworks like Spring or Micronaut. Grails is still around, GORM is still one of the best ORM libraries you can use and Groovy is adding new fantastic features like GINQ.
Groovy is not in the Tiobe list of popular programming languages, but then again Tiobe are the guys who have Ada ahead of TypeScript. Go figure.
But why should YOU learn Groovy?
- Excellent interoperability with Java. You can mix and match Groovy and Java classes in the same project.
- First-class support in IDEs like IntelliJ
- Friendly syntax and easy to learn. If you are a skilled Java developer, you should feel very productive with Groovy in a matter of days, and not months.
- All the great features of the JVM platform: the same jar file across all operating systems, excellent garbage collection mechanism, access to millions of Java libraries, etc…
- Actively developed and compatible with Java, from JDK 8 to JDK 19.
- Fully open source.
- If something can be built with Java, it can also be built with Groovy. Yes, that includes Android applications.
- No semicolons. Seriously, maybe you don’t care, but it is a big deal to me.
In the coming days and weeks, I will be writing about Groovy and why it is still an awesome language. Somebody has to do it 🙂