Hello, world! A first look at Groovy

2013-10-06 in groovy java
Real programmers don't use `println`

The first look at any programming language often begins with the traditional “hello world” program. Below is Java’s, for reference.

HelloWorld.java

1public class HelloWorld {
2  public static void main(String args[]) {
3    System.out.println("hello world");
4  }
5}

Groovy’s, on the other hand, looks like this:

HelloWorld.groovy

1class HelloWorld {
2  static def main(args) {
3    println("hello world")
4  }
5}

Groovy: The Defective "Swiss Army Hammer"

2013-10-06 in groovy grails gradle java

Gr- — (Javanese) Agglunative prefix, typically indicating expectation of a painful experience, often due to lack of forethought or impropper planning.

Example constructs include:

  • Groovy — Adjective. Characterised by a large number of hacks attempting to make things better, but which really only increase the number of problems by an order of magnitude. “That’s some groovy code you’ve got there. I especially like how it uses the query parameters to dynamically select the class and static method to execute.”

  • Grail(s) — Verb (almost always found in the singular present). To inflict suffering and confusion by means of unnecessary complexity, self contradiction, and annoying surprises separated by excrutiating waits. “It really grails me how this ‘convention over configuration’ framework requires three multi-thousand-line configuration files to run.”

  • Gradle — Noun. An obstensibly comfortable, metaphorical location in which something is cradled before finally succumbing to death. “After having been in gradle for a few months, we found that the code had become impossible to update, due to library version conflicts.”