Jump to content

Talk:Apache Groovy

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Aptasii (talk | contribs) at 13:55, 23 November 2013 (discuss list of developers). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.



Groovy Paradigms

Should "functional" be added to the list of Groovy Paradigms? It certainly seems to fit, given Groovy's extensive list of functional constructs. —Preceding unsigned comment added by 129.82.29.25 (talk) 14:30, 1 August 2008 (UTC)[reply]

Explanation of the Name "Groovy"

In slang and informal language, "groovy" is an adjective describing an unspecified fashionable or desirable quality. It can also be used as a generally positive exclamation. It originated in Britain, and largely remains a British word. "Groovy" has slightly outdated connotations in recent times, although it can still be used in everyday speech.

I removed this from the article because wikipedia is not a dictionary and the definition has no relation with the programming language discussed in the article. -- Taku 02:47, Apr 25, 2005 (UTC)


I agree, and I removed the following which is even less desirable -- MarkBrooks 03:12, 13 October 2005 (UTC)[reply]

Groovy is an adjective to describe the state of being 'cool', 'hip', or generally 'awesome'
The lack of a sense of irony or tongue-in-cheek fun is a sad thing. The "definition" reflects the spirit of the originators of the language, and plays a valuable part in the encyclopedia entry. It's there not because Wikipedia is a dictionary but because we learn more about James Strachan and friends by seeing what the name means. We don't need the definition removed; we need it enhanced by an explanation of why they picked it. Webmink 05:18, 13 October 2005 (UTC)[reply]
You want grins and giggles, go read the Encyclopaedia Britannica. Seriously though, I came to this article as a user seeking information, and I felt that the lead-in as written didn't add anything to my knowledge, detracted from the article's tone, and was simply an unnecessary distraction. Maybe somebody who didn't know what the word "groovy" meant would feel differently. BTW, back when this word was in common usage, I don't think "awesome" would have been used in quite the same way. Maybe you could quote the developer's reasons for choosing that name, to put the definition in context? -- MarkBrooks 09:22, 16 October 2005 (UTC)[reply]
Attempts by several people to indicate the colloquial meaning of the term have now been discarded, not because they were bad or excessive like the original attempt (which I agreed was wrong) but simply because "wikipedia is not a dictionary". . Clearly there's demand for at least a nod towards the colloquialism. Are there any other editors of this page who wish to express an opinion? Webmink 03:43, 31 October 2005 (UTC)[reply]
Personally, I think the original definition (the one at the top of this section) was superior to subsequent attempts and wouldn't object to its inclusion, particularly if a connection could be made with the choice of name for the programming language. Otherwise maybe a disambiguation page would be a better idea? -- MarkBrooks | Talk 01:36, 1 November 2005 (UTC)[reply]
Since I know it would be hard to write a full article about the adjective groovy, I added the wiktionary link to satisfy those who just want a definition. Bkkbrad 12:15, 2 November 2005 (UTC)[reply]
Cool, thanks. -- MarkBrooks | Talk 17:29, 3 November 2005 (UTC)[reply]

Features of Groovy compared to those of Java

I believe Java does have native syntax for arrays. BDKosher 21:05, 12 February 2006 (UTC)[reply]

yes, it has --217.86.138.17 12:55, 31 October 2006 (UTC)[reply]

String[] list = { "Rod", "Carlos", "Chris" };
List<String> shorts = new ArrayList();
for (String item : list) {
    if (item.length() <= 4) {
        shorts.add(item);
        System.out.println(item);
    }
}

and the syntax comparison is neither side-by-side nor representative.


To be fair, the Groovy code is using a List and not an Array (which Groovy supports, as well). However, also to be fair, the Groovy code doesn't create a second List of the short Strings and then print them. It just prints them as it finds them. The above example gets rid of the iteration through the second List, but still instantiates it and adds Strings to it.

I propose that the Java code be changed to the following:


class Filter {
    public static void main(String[] args) {
        List<String> list = Arrays.asList("Rod", "Carlos", "Chris");
        for (String item : list) {
            if (item.length() <= 4) {
                System.out.println(item);
            }
        }
    }
}

Jerri Kohl 22:16, 4 May 2007 (UTC)[reply]

History of Groovy

Groovy was originally conceived in 2003(?) as a more Ruby-like language for the Java Virtual Machine. Groovy Beta 1.0 announcement on James Strachan's blog —The preceding unsigned comment was added by 66.138.72.243 (talk) 03:51, 3 January 2007 (UTC).[reply]

Redirect

Is there any particular reason why this article is at "Groovy (programming language)" rather than just at "Groovy", since the latter is just a redirect here? --  timc  talk   18:36, 21 March 2007 (UTC)[reply]

I don't see the point as well. Will create a disambig page.--sin-man 04:23, 3 April 2007 (UTC)[reply]

Markup Language support--don't see how this makes Groovy special.

How is markup language support any more special in Groovy than any other language? The example provided can be accomplished in a whole array of other languages using their standard libraries. This seems a pretty weak example to demonstrate a differentiating feature. Can something more robust be demonstrated that truly differentiates Groovy markup support from other languages?

Ehogberg (talk) 19:45, 29 January 2008 (UTC)[reply]

The language that Groovy intends to be a complement for/alternative to is Java. As a matter of fact, Groovy was designed to be easy to learn for Java programmers, while offering the more powerful features found at the time in other scripting/dynamic languages such as Python and Ruby. In this context, maybe the markup example should also be provided in Java? Ogourment (talk) 16:42, 11 February 2008 (UTC)[reply]
I added a Java example (using the XML DOM libraries provided with the Sun JDK); if I'm understanding correctly what's supposed to be special about markup languages in Groovy, it's that there's an inline syntax for building documents that A) doesn't care what format the document will ultimately be in, as long as it can be expressed as a DOM tree, and B) doesn't require explicit method calls for setting up each element and attribute. evildeathmath 16:50, 16 July 2008 (UTC)[reply]

Upon further reflection, I am tempted to add this version to the article as well:

System.out.println("<workbook>");
System.out.println("  <worksheet caption=\"Employees\">");
System.out.println("    <row fname=\"John\" lname=\"McDoe\"/>");
System.out.println("    <row fname=\"Nancy\" lname=\"Davolio\"/>");
System.out.println("  </worksheet>");
System.out.println("  <worksheet caption=\"Products\">");
System.out.println("    <row id=\"sku34510\" name=\"Veeblefeetzer\"/>");
System.out.println("    <row id=\"sku3a550\" name=\"Prune Unit Zappa\"/>");
System.out.println("  </worksheet>");
System.out.println("</workbook>");

On the one hand, it's pedantic, silly, and poor programming practice; on the other hand, it's likely what 9 out of 10 programmers would do if all they needed was a short XML snippet. evildeathmath 16:58, 16 July 2008 (UTC)[reply]

DOM Compliance

The article refers to an inline DOM syntax linked to DOM which is the w3c standard DOM. What i'm getting at is that DOM is an API standard whereas Groovy appears to implement it's own API, or rather allow xml construction using language features. Dylan.star (talk) 14:45, 3 September 2008 (UTC)[reply]

Groovy's syntax can be made far more compact than Java

Are you serious? The shown examples just saves 6 or 8 characters. This is a bit more compact but not far more compact. --87.78.132.86 (talk) 09:36, 2 February 2009 (UTC)[reply]

Currently it is a better example but I find my naïve intuition doubting the validity of the groovy code:

 for (String it : new String[] {"Rod", "Carlos", "Chris"})
     if (it.length() <= 4)
         System.out.println(it);

can be expressed in Groovy as:

 ["Rod", "Carlos", "Chris"].findAll{it.size() <= 4}.each{println it}

"it" is spontaneously defined? No note is made to suggest whether the use of the key-word declares it or not (ie, it is pretty obvious that both instances of "it" are separate variables, but does Groovy reserve "it" as a local variable name? or could the variable name have been chosen differently in each loop?) Either way "it" is a neat effect, just not as clear as I would hope an encylopedia example to be. --— robbiemuffin page talk 12:16, 15 April 2011 (UTC)[reply]

'it' is a defaulting name for a single argument closure (when none is provided). The following code is equivalent:

["Rod", "Carlos", "Chris"].findAll{it -> it.size() <= 4}.each{it -> println it}

Or:

["Rod", "Carlos", "Chris"].findAll{x -> x.size() <= 4}.each{x -> println x}

86.184.48.155 (talk) 15:00, 18 November 2013 (UTC)[reply]

Superset?

I find the article's claim that "The Groovy language is largely a superset of the Java language. One can usually rename a .java file to a .groovy one and it will work (though there are a few incompatibilities)." fairly dubious. Looking at http://groovy.codehaus.org/Differences+from+Java, it seems that there are several major changes that will break existing Java code:

  1. Array literals
  2. == operator
  3. For loops with multiple indexes (i.e. for(int i = 0; j = 0; etc.)
  4. Changing the default accessibility from package-private to public (is there even a way to use package-private in Groovy)
  5. No inner classes (except their new closures)

Given all these, I would be surprised if any non-trivial Java project could be compiled as Groovy. Superm401 - Talk 05:32, 9 April 2009 (UTC)[reply]

Also, of course Java allows you to use something like:
{
int a = 3;
System.out.println(a);
}
when you just want to create a new scope for whatever reason. This is considered ambiguous by Groovy's compiler. Superm401 - Talk 05:48, 9 April 2009 (UTC)[reply]

Yep. Claims with vague terms like "largely" and "usually". The Wordpress.com blog referenced later in the section seems to be the source. It says "Much of the time you can simply rename a .java file with the .groovy extension - the Java syntax is mostly a subset of the Groovy syntax". I don't think it can be considered a reliable source, falling foul of limitations outlined at Wikipedia:RS#Self-published_sources. FWIW, it's not my experience (calling your Java classes from Groovy is the way to go), so my personal scepticism of this self-published source is confirmed. William Avery (talk) 08:47, 9 April 2009 (UTC)[reply]

AFAIK, any Java code will be parsed correctly as Groovy code apart from anonymous inner classes (mainly due to the braces {} inside a method, that Groovy will consider a closure. AxiomShell (talk) 22:40, 28 June 2009 (UTC)[reply]

Groovy as a "standard"

I've marked this claim in the first paragraph as "dubious." The cited source makes the claim:

"Since the passage of JSR-241, Groovy is the second standard language for the Java platform (the first being the Java language)."

but if you visit the page for JSR-241, it is clearly marked as "inactive," which means it was never made "final." It seems to me that the only sense of the word "standard" that is accurate for the JCP is a JSR in "final" status. —Preceding unsigned comment added by 132.174.23.57 (talk) 19:52, 12 February 2010 (UTC)[reply]

Wrong link

The link to Curly_bracket_programming_language redirects to a page that doesn't include any list of "curly bracket programming languages". 87.63.228.190 (talk) 09:51, 11 February 2011 (UTC)[reply]

Developer

It doesn't seem appropriate to show Guillaume as the "developer" since his involvement is primarily as project manager. Either the project should be listed (for example Python lists the Python Software Foundation) or if individuals are going to be shown then the determination should be a few (as in no more than three I think) of the developers who have done the most work (such as Jochen and ???). — Preceding unsigned comment added by JamesPaulWhite (talkcontribs) 23:29, 12 October 2012 (UTC)[reply]

You're right, but the list of despots at http://xircles.codehaus.org/projects/groovy/members didn't seem to reflect the actual developers involved until a few months ago. By excluding Codehaus administrator Ben Walding, and adding Jochen's title "Tech Lead" in his Groovy mailing list signature, we should add "Jochen Theodorou (Tech Lead), Paul King, Cedric Champeau".