views:

93

answers:

3

As my question already implies I want to learn a new language and have read several articles about groovy and its more pragmatic syntax. SO I have choosen Groovy as the language of my choice.

What is a good way to learn a new language like Groovy when I already know the fundamentals of Java. When I understand correctly Groovy will be running in the Java Virtual Machine and allows me to always rely on what I know from Java when I don't know how to solve the problem in Groovy.

I am looking for hints on how to organize a learning track to learn this language. I found that page explaining the differences: http://groovy.codehaus.org/Differences+from+Java But what I am looking for is more a tutorial where I can get through and get introduced to the differences.

+4  A: 

There are a couple of articles which have been written with that specific goal in mind: "From Java to Groovy in a few easy steps", part 1 and part 2. They were written by Gillaume Laforge, one of the masterminds behind Groovy. The articles are well written, easy to follow and provide a nice introduction for Java developers. Also, there is the Beginners tutorial in the official Groovy documentation.

Once comfortable with the basics, it's easy to move on to the on-line Groovy task-specific documentation.

Tomislav Nakic-Alfirevic
Thank you for these resources! I need to have some further investigation to read and understand them.
Liuh
A: 

You might also take a look at this article by James Strachan, the author of Groovy:

http://macstrac.blogspot.com/2009/04/scala-as-long-term-replacement-for.html

Vince O'Sullivan
+1  A: 

Personally I find that referencing an old language that I know to learn a new language is not a good idea. The reason I say this is that in a new language you want to learn to express and use data structures, idioms, style, etc in THAT language. You want to Groovy developers to say that the code is written by a Groovy developer rather than a Java developer.

An example, using Groovy and Java, is that Java developers tend to use a loop for collections, but in Groovy tend to use closure. They may look the same, but they are not. In Java we are applying to data to the code, whereas in Groovy we are applying the code to data. Learning this subtle difference is important to understanding the rest of Groovy API and will help you to grasp that concept.

Also I think that this approach of learning a new language referencing and old might not work that well with other styles of programming like functional.

Chuk Lee
That are interesting points, thank you. But still I think it is a good foundation to know that there is always a fallback solution back to Java while you are learning Groovy.
Liuh