Book Image

Groovy for Domain-Specific Languages, Second Edition

By : Fergal Dearle
Book Image

Groovy for Domain-Specific Languages, Second Edition

By: Fergal Dearle

Overview of this book

Table of Contents (20 chapters)
Groovy for Domain-specific Languages Second Edition
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
1
Introduction to DSLs and Groovy
Index

Groovy as a teaching language


I've had the wonderful opportunity in the last year to be involved with the CoderDojo Foundation via my local CoderDojo. CoderDojo is a global movement of free volunteer-led, community-based programming clubs for young people at https://coderdojo.com. I joined Wexford CoderDojo as a mentor in January 2015.

The club was teaching a Java class to the more senior students who had already graduated from Scratch and HTML. The mentors were struggling with teaching Java to youngsters. The amount of ceremony needed to set up even a simple HelloWorld.java class was hard for the kids to grasp. The fact that you need a class and a main method and all those semicolons caused a lot of puzzled faces and most of the classes were occupied with helping the kids correct simple syntax errors.

My immediate reaction was, "Ouch! I don't want to be teaching Java", so I suggested we try Groovy instead. In that way, all we needed to do for a Hello World script was:

println "Hello, World...