File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Groovy and the fly likes Why choose groovy? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » Groovy
Bookmark "Why choose groovy?" Watch "Why choose groovy?" New topic
Author

Why choose groovy?

Matt Williams
Greenhorn

Joined: Feb 06, 2008
Posts: 14
What differentiates groovy from other dynamic languages running in the JVM, such as Jython and JRuby? What are the benefits of choosing groovy over these other languages?

Thanks!
M Rama
Ranch Hand

Joined: Mar 04, 2005
Posts: 91
Adding to the question, since Groovy is primarily targeting Java developers, isn't Ruby a better bet since it attracts .NET developers as well. With capabilities of Ruby and Groovy being similar, isn't going the JRuby way a better choice.

What has been your experience with the .NET world embracing Ruby? Also, do you feel there being any big drawback in doing JRuby instead of Groovy?
Venkat Subramaniam
Author
Ranch Hand

Joined: Jan 28, 2008
Posts: 79
I program in Java and also program in .NET (I wrote the book ".NET Gotchas" a few years ago). I program in Ruby and also in Groovy. I believe in using the right language for the right job. One thing I try to avoid is bias or prejudice towards any language (OK except when it comes to VB perhaps, just kidding).

Using Ruby because it runs natively, on JVM, and also on DLR is not a convincing reason to select Ruby or JRuby for my project on the JVM.

If my project is predominantly a Java project, if I have to interact heavily
with Java libraries and APIs and frameworks, and at the same time I want to take advantage of the capabilities and features of a dynamic language, I find that Groovy is a better choice. I can leverage the strengths of two languages in one.

On the other hand, if I have really nothing to do with Java on a project, but want the dynamic language capabilities, I tend to prefer Ruby (assuming it serves my needs that is). If I want to deploy my solutions on the JVM, purely from the point of view of organizational deployment issues and restrictions, or if I want to take advantage of the performance gains I will get by using the JVM, then I prefer the Ruby/JRuby route.

Now from the point of view of learning, which one should you select? If you are already on a Java project, I suggest Groovy. If you are not on a Java project, I suggest Ruby. Once you learn one, you can pretty easily pick up the other if you need to. Ignoring the syntax differences and a few other capability differences, there is a common set of concepts and paradigm that you will get introduced to when you learn either one of them and you can use them when you switch to any of the other languages that offer similar concepts.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Why choose groovy?
 
Similar Threads
* Welcome Venkat Subramaniam
what are scripting languages supported by java?
How is java a software platform and is c one as well
One to many mapping of properties in java
What is Groovy and in which cases we need Groovy?