• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Anyone already uses Groovy

 
Joe Harry
Ranch Hand
Posts: 10080
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

Out of your Groovy user experience, can you guys please post the pros and cons of using it simultaneously with Java?
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We use it as an embedded scripting language for our reporting platform that is written in Java, and it's working quite well. There are some minor pitfalls, some differences that you need to get used to - such as the way return values are handled, and some later features still missing from Groovy (such as varargs). But in the end, I think it was the right decision.
 
Joe Harry
Ranch Hand
Posts: 10080
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good to know. Thanks!
 
Joe Harry
Ranch Hand
Posts: 10080
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How is the community looking at it when building Enterprise apps?
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jothi Shankar Kumar Sankararaj:
How is the community looking at it when building Enterprise apps?


I don't think I understand the question. Can you please elaborate? Thanks!
 
Joe Harry
Ranch Hand
Posts: 10080
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I meant to say, when we have a new software or a new version of the existing software, it takes some time for the community to really adopt it. For some softwares which are really attractive, the adoption rate is much higher and it penetrates like anything to be widely used as soon as it is launched. So in this sense, how good the community is responding to the usage of Groovy in commercial enterprise projects?
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Frankly, I don't know. Perhaps someone else can answer this...
 
Raj Chila
Ranch Hand
Posts: 128
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I stumbled across Groovy while I was looking at 'canoo' on Hudson.

Frankly I dont yet know or have seen a need for using Groovy yet, but here are some questions I would like to ask.

1. How different is it from BeanShell?
2. I have briefly looked at the syntax and it looks like memorizing a completely new language in contrast to beanshell where you could use the same java syntax.

Ilja, I am sure you must have evaluated alternatives, can you elaborate why Groovy?
[ July 13, 2008: Message edited by: Raj Chila ]
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) I don't know much about BeanShell, but it seems that your second question already answered this one.

2) I would summarize our reasons as

- Groovy being the "official" scripting language for Java
- it having a couple of language that make it seem potentially worthwhile to learn a new language, and
- learning a new language from time to time being fun and a good idea
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Raj Chila:
2. I have briefly looked at the syntax and it looks like memorizing a completely new language in contrast to beanshell where you could use the same java syntax.

This is not true about Groovy. You can make your Groovy code look as much like Java as you wish. But if you want to avoid the clunky, messy, extra syntax of Java, you can make your code better by switching over to some of the Groovyisms that make the language more powerful.

In this respect, it is much like BeanShell. However, the Groovy documentation focuses on what's newly available while the BeanShell documentation for some reason stresses how to do things exactly the same way as Java.

I'm currently using Groovy (and Grails) in an SOA application. It's been terrific.
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's a result of a search for groovy & java on monster.com.
 
Raj Chila
Ranch Hand
Posts: 128
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ilja and Marc,

"Learning a new language from time to time being fun and a good idea"

I Surely agree with that..and every new language or versions of it evolve because they are better or give us more 'ability' to do things better and do more with little code.

It is good to know that syntax is not an issue Marc. From the adaptability point of view, I would surely like to go with java like syntax and get more and more Groovy while I am at it. and also thanks for sharing the link.
 
Matthew Taylor
Rancher
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jothi Shankar Kumar Sankararaj:
I meant to say, when we have a new software or a new version of the existing software, it takes some time for the community to really adopt it. For some softwares which are really attractive, the adoption rate is much higher and it penetrates like anything to be widely used as soon as it is launched. So in this sense, how good the community is responding to the usage of Groovy in commercial enterprise projects?


You might be surprised to find out that the enterprise application you are working on already has some Groovy code in it! Groovy can be embedded into an Ant build file, with some really powerful results (if you don't want to move to Gant. It is so easy to add the Groovy jar to the project classpath, it's possible that no one would even notice it was there.
 
Jason Mayer
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just wanted to mention that when I first started writing groovy code, I tended to write it in standard java, and later groovify it. So no, there is no "new syntax". It's standard Java (without the pain). That said, I tend to write straight groovy code now without the Java pain.

I wrote this sample for you all. It demonstrates some of the nicer features of the language I think.



Frankly, I love this language. It's a nice transition towards a more modern language for us Java folks who couldn't get Ruby approved in the workplace a few years ago.
[ October 22, 2008: Message edited by: Jason Mayer ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic