Skip to content

Introduction

BillKress edited this page Jan 13, 2013 · 3 revisions

Over the past 6 months or so I've been developing a set of Groovy scripts to help me at work. I started out with a few simple tasks and just kept adding to them. This has been a fantastic experience--I've come up with quite a few interesting scripts patterns and reusable functions and I've had a great time doing so.

Groovy is amazingly easy to pick up, if you are a java programmer--well you can take any Java source file and compile it with the groovy compiler so it's a pretty seamless transition. I started from a pure Java knowledge base and just added in pieces of Groovy one at a time.

This "Wiki" is intended to be a programming blog/tutorial for learning Groovy with code behind each step. I don't have any of this code finished--I won't be using the code I developed at work but will be starting over, so I expect there will be quite a few changes/revisions. For each wiki page I'll have a goal/requirements, a summary of what I came up with and a blog that will be way too verbose where I'll try to explain anything new. I'll also post a GIT tag for each page because I tend to go back and refactor code long after it's "Finished", sometimes changing entire structures.

Advantages and disadvantages of Groovy as an os-level scripting language

Advantages

  • Groovy is a natural choice for Java programmers--zero mandatory learning curve (You can start right away), and the rest of the learning curve is very gentle, you can learn one feature at a time as needed.
  • Groovy execution is very fast and reliable. Groovy compiles into Java class files.
  • Groovy has access to everything Java does--every library and tool.
  • Since groovy is a scripting language, you can just save your .groovy file and run. There are also interpreters like GroovyConsole that are great for trying out code.
  • It's available on every platform Java is available on (and the code tends to work across platforms)

Disadvantages

  • Groovy startup is slow--the first start after a reboot can be brutal--It has to load java and a compiler. After the first run the starts usually just take a second or two (I guess Groovy and Java are cached at that point).
  • It won't be as deeply intertwined with windows as a .net language (for obvious reasons).
  • It generally requires a few environment variables (often set by the installer).
  • Requires java.

Clone this wiki locally