If you are here, it most likely means that you are interested in seeing some of the cool features of Groovy as opposed to the Java counterparts.
When Groovy and Grails first became popular, we were still on Java 1.7, so no closures etc. If you are already adept at Java 1.8, most of the interesting things we explain here will not be completely new to you.
In Java it is relatively hard to create a list:
|
Compare this with the elegant Groovy solution with a list literal, and the built-in println.
|
Using maps is even more cumbersome:
|
Groovy has a literal syntax, allowing you to do:
|
A closure is similar to a method that can be passed around as a reference, or an argument to a method. Many methods in the GDK use closures too, especially when it comes to collections. A few examples are:
|
|
|
The Elvis operator helps with the following common pattern:
|
instead of the explicit null check, you can use the Elvis operator:
|
Elvis uses Groovy truth. If value
was 0
then another
would be 15
.
Look at Careers on our website or apply directly. While you wait, check out the Groovy documentation.