-
Notifications
You must be signed in to change notification settings - Fork 1
Description
"Before I explain how to install and set up Groovy, consider this: w" → W
Java platform → Java Platform
Re Java runtime, Groovy required JDK, JRE is not sufficient.
Re getting JDK, all platforms with package management can install OpenJDK via package management, much easier than downloading and installing OracleJDK.
Emphasize scripting a bit more in the need for a JDK/Groovy installation: Groovy can be used like Python, Ruby or Perl.
Groovy installation: on Debian "aptitude install groovy2", on Fedora "yum install groovy".
I am a strong advocate of using groovyConsole as the initial teaching tool for people who do not already use IntelliJ IDEA, NetBeans, Eclipse,... I would probably not even mention http://groovyconsole.appspot.com/
"Let’s now try out the Pythagorean Theorem. You do remember that from school, don’t you?" I'd lose that second sentence, potentially a bit condescending, and indeed makes many assumptions that may not be true for the reader.
The code delivers 5.0 not 5, why? (I know, but the reader may be surprised.)
I would use final rather than def: introduce people to creating bindings rather than variables. With Groovy 2.5 this is now checked (finally). Alternatively do things with a declaration using the Script binding, make it more Pythonic. No need to mention why it works at this stage.
10.getClass() → 10.class Use the property syntax initially, then do the method call form later?
am a great fan of showing people broken code and the errors produced, but some of Groovy's error messages are a real turn off, especially for people new to Groovy. Maybe say that the print1n() is gratuitously horrible so as to deal with this by siding with the reader?
"Ignore the for loop and println() statements for the moment and just focus on the results of executing
the script." → "We'll look at the loop and print statements shortly, for now let us focus on the results of executing the script."
[[Have to go now, more later.]]