2 ms·
I've been building the web app I'm working on completely in Groovy, and running it on Google App Engine. I'm quite happy with my choice to switch over to Groovy
by Spines11 15y ago
I've been building the web app I'm working on completely in Groovy, and running it on Google App Engine. I'm quite happy with my choice to switch over to Groovy from Java. There are 3 main features of Groovy that greatly speed up my productivity as compared to coding with Java.
1. Closures - items.find { it.name == 'groovy' } is much easier than looping.
2. Language support for collections - Maps can be declared like: [key:'value'], and lists can be declared like: [1,2,3].
3. Easier handling of nulls - The "Elvis Operator" can be used to specify defaults like: (item ?: "defaultvalue") and the safe navigation operator will return null rather than throwing a NullPointerException when doing something like this: (item?.address?.street).