The core abstract programming model of Ruby and Groovy are very similar: everything is an object, there is a MOP in control of all activity, and closures are the core structuring tool after classes. Ruby uses the Ruby library, Groovy uses the Java library with some additions of its own. This is the biggest difference but it is a huge difference. Syntactically, things like:
becomes:
which doesn't show that the Groovy closures syntax is:
which is slightly different from Ruby, but does show that sometimes Groovy has a different approach to certain things compared to Ruby. So in moving from Ruby to Groovy, there are gotchas.
2 Comments
Hide/Show CommentsJan 17, 2008
David Billskog
The comparison is misleading as the ruby example does more then the groovy example. Wouldn't a more fair comparison be like:
and closures
or am I missing something?
Jul 07, 2009
Luoh Ren-Shan
ruby: puts IO.read("blah")