<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://groovy.dzone.com"  xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dz="http://www.developerzone.com/modules/dz/1.0" xmlns:media="http://search.yahoo.com/mrss/">
<channel>
 <title>Groovy Zone - Comments for &quot;From Java to Groovy, part 2: closures and native syntax for lists&quot;</title>
 <link>http://groovy.dzone.com/news/java-groovy-part-2-closures-an</link>
 <description>Comments for &quot;From Java to Groovy, part 2: closures and native syntax for lists&quot;</description>
 <language>en</language>
<item>
 <title>Just for protocol, as we</title>
 <link>http://groovy.dzone.com/news/java-groovy-part-2-closures-an#comment-591</link>
 <description>&lt;p&gt;&lt;!--paging_filter--&gt;
&lt;p&gt;Just for protocol, as we say in Russian police... &lt;/p&gt;
&lt;p&gt;We (Groovy community) put huge efforts to make Groovy as fast as possible by dynamic nature of the language and we already achieved huge progress  compare to what we had in 1.0 and next version 1.6 has good chances to become much more faster compare to 1.5.x. &lt;/p&gt;
</description>
 <pubDate>Mon, 04 Feb 2008 16:10:34 -0500</pubDate>
 <dc:creator>alext</dc:creator>
 <guid isPermaLink="false">comment 591 at http://groovy.dzone.com</guid>
</item>
<item>
 <title>Thank you, Guillaume, for</title>
 <link>http://groovy.dzone.com/news/java-groovy-part-2-closures-an#comment-576</link>
 <description>&lt;!--paging_filter--&gt;&lt;p&gt;Thank you, Guillaume, for clarification, I see your points.&lt;/p&gt;</description>
 <pubDate>Mon, 04 Feb 2008 05:15:44 -0500</pubDate>
 <dc:creator>vaclav</dc:creator>
 <guid isPermaLink="false">comment 576 at http://groovy.dzone.com</guid>
</item>
<item>
 <title>Actually, I&#039;m mainly</title>
 <link>http://groovy.dzone.com/news/java-groovy-part-2-closures-an#comment-574</link>
 <description>&lt;!--paging_filter--&gt;Actually, I&#039;m mainly abandoning static typing to make my examples more idiomatic Groovy. But it&#039;s not really necessary here. I usually keep typing information when I believe it improves readability, or when a solid contract has to be shared with the calling code (especially when my Groovy code is reused by some Java classes). Furthermore, clever IDEs do type inference and even without explicit type information, it understands that a list is a list, etc. An interesting aspect to consider: method calls are faster when you omit types, as there&#039;s less type checking going on under the hood.</description>
 <pubDate>Mon, 04 Feb 2008 04:08:19 -0500</pubDate>
 <dc:creator>glaforge</dc:creator>
 <guid isPermaLink="false">comment 574 at http://groovy.dzone.com</guid>
</item>
<item>
 <title>I&#039;m curious about the step</title>
 <link>http://groovy.dzone.com/news/java-groovy-part-2-closures-an#comment-571</link>
 <description>&lt;!--paging_filter--&gt;&lt;p&gt;I&#039;m curious about the step when static typing was abandoned. What benefits do we get from that? Shouldn&#039;t we keep type info and benefit from type-checking, type-aware IDE code-completion and code inspections?&lt;/p&gt;&lt;p&gt;You see, I&#039;m a bit petrified in the Java coding style and have hard time justifying removing type info for no aparent reason. &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
 <pubDate>Mon, 04 Feb 2008 01:43:30 -0500</pubDate>
 <dc:creator>vaclav</dc:creator>
 <guid isPermaLink="false">comment 571 at http://groovy.dzone.com</guid>
</item>
<item>
 <title>Thanks for the responses. </title>
 <link>http://groovy.dzone.com/news/java-groovy-part-2-closures-an#comment-568</link>
 <description>&lt;!--paging_filter--&gt;Thanks for the responses.  i really did not have the intention of making this to a thread of improving the Java code in the example (ok, sure it could be even better as using generics supported Google collections Predicates, or Lists helpers). i believe writing a nice and elegant Java code example would not effect the value of this kind of articles. just lets be fair.</description>
 <pubDate>Mon, 04 Feb 2008 00:01:05 -0500</pubDate>
 <dc:creator>afsina</dc:creator>
 <guid isPermaLink="false">comment 568 at http://groovy.dzone.com</guid>
</item>
<item>
 <title> the code i tried to write</title>
 <link>http://groovy.dzone.com/news/java-groovy-part-2-closures-an#comment-566</link>
 <description>&lt;!--paging_filter--&gt; the code i tried to write seems to be messed up after formatting..</description>
 <pubDate>Sun, 03 Feb 2008 23:42:58 -0500</pubDate>
 <dc:creator>afsina</dc:creator>
 <guid isPermaLink="false">comment 566 at http://groovy.dzone.com</guid>
</item>
<item>
 <title>Unfortunately Ahmet, you</title>
 <link>http://groovy.dzone.com/news/java-groovy-part-2-closures-an#comment-564</link>
 <description>&lt;!--paging_filter--&gt;&lt;p&gt;Unfortunately Ahmet, you left some lines out from your example: no imports, no class definition. I know developers are not stupid, but what about &amp;quot;programmers&amp;quot; ? a developer is a person that takes pride in his/her craft so he/she is always looking for info and learning new things; in contrast a programmer is just doing what he/she is told (no thought process involved in most of the cases, sad but true). These are the persons that flood forums and chat sessions with &amp;quot;bad/verbose&amp;quot; code as the one you see at the beginning of the article. This article is more oriented to programmers, people that do the heavy lifting but developers can also benefit from reading them.&lt;/p&gt;&lt;p&gt;As you pointed out, using a helper library may reduce the code, so here is my take using commons-collection, which I think could also be improve.&lt;/p&gt;&lt;pre class=&quot;java&quot;&gt;import static java.lang.System.out;&lt;br /&gt;import static java.util.Arrays.asList;&lt;br /&gt;import java.util.ArrayList;&lt;br /&gt;import java.util.List;&lt;br /&gt;import org.apache.commons.collections.CollectionUtils;&lt;br /&gt;import org.apache.commons.collections.Predicate;&lt;br /&gt;&lt;br /&gt;public class ListTests {&lt;br /&gt;   public static void main( String[] args ) {&lt;br /&gt;      List&amp;lt;String&amp;gt; names = asList( &amp;quot;Ted&amp;quot;, &amp;quot;Fred&amp;quot;, &amp;quot;Jed&amp;quot;, &amp;quot;Ned&amp;quot; );&lt;br /&gt;      out.println( names );&lt;br /&gt;      List&amp;lt;String&amp;gt; shortNames = new ArrayList&amp;lt;String&amp;gt;();&lt;br /&gt;      shortNames.addAll( names );&lt;br /&gt;      CollectionUtils.filter( shortNames, new Predicate(){&lt;br /&gt;         public boolean evaluate( Object input ) {&lt;br /&gt;            return ((String) input).length() &amp;lt; 4;&lt;br /&gt;         }&lt;br /&gt;      } );&lt;br /&gt;      out.println( shortNames.size() );&lt;br /&gt;      for( String s : shortNames )&lt;br /&gt;         out.println( s );&lt;br /&gt;   }&lt;br /&gt;}&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
 <pubDate>Sun, 03 Feb 2008 21:57:38 -0500</pubDate>
 <dc:creator>aalmiray</dc:creator>
 <guid isPermaLink="false">comment 564 at http://groovy.dzone.com</guid>
</item>
<item>
 <title>Thanks, Ahmet, I really</title>
 <link>http://groovy.dzone.com/news/java-groovy-part-2-closures-an#comment-562</link>
 <description>&lt;!--paging_filter--&gt;Thanks, Ahmet, I really think this is the best type of discussion - one which can focus on the code. I look forward to seeing if/how other community members will respond.</description>
 <pubDate>Sun, 03 Feb 2008 21:13:09 -0500</pubDate>
 <dc:creator>rick</dc:creator>
 <guid isPermaLink="false">comment 562 at http://groovy.dzone.com</guid>
</item>
<item>
 <title>afsina wrote:Due all</title>
 <link>http://groovy.dzone.com/news/java-groovy-part-2-closures-an#comment-560</link>
 <description>&lt;!--paging_filter--&gt;&lt;p&gt;&lt;div class=&quot;quote&quot;&gt;&lt;div class=&quot;quote-author&quot;&gt;&lt;em&gt;afsina&lt;/em&gt; wrote:&lt;/div&gt;Due all respect, please stop writing java code exaggeratedly verbose. Telling &amp;quot;We could certainly improve this Java example by using the Arrays#asList() method...&amp;quot; or not using enhanced for loops deliberately in two places, putting unnecessary declaration are not the correct way of making a case that groovy syntax is not verbose. Developers are smart, let them decide by themselves. Put your efforts to make groovy not 100 times slower then java compiled code first please.&lt;/div&gt;&lt;/p&gt;&lt;p&gt;In the spirit of positive dialogue, I think it would be good in a reply like this to actually include a rewrite of the code in question.  A respectful exchange between several programmers, focused solidly on the code, is sure to have helpful results. I bet I&#039;m not the only one who would like to see the non-verbose Java code you&#039;re thinking of, so we can compare it against the Groovy code for the discussion. That would be pretty neat.&lt;/p&gt;&lt;p&gt;Thanks,&lt;br /&gt;Rick &lt;/p&gt;</description>
 <pubDate>Sun, 03 Feb 2008 19:43:19 -0500</pubDate>
 <dc:creator>rick</dc:creator>
 <guid isPermaLink="false">comment 560 at http://groovy.dzone.com</guid>
</item>
<item>
 <title>Due all respect, please stop</title>
 <link>http://groovy.dzone.com/news/java-groovy-part-2-closures-an#comment-559</link>
 <description>&lt;!--paging_filter--&gt;Due all respect, please stop writing java code exaggeratedly verbose. Telling &amp;quot;We could certainly improve this Java example by using the Arrays#asList() method...&amp;quot; or not using enhanced for loops deliberately in two places, putting unnecessary declaration are not the correct way of making a case that groovy syntax is not verbose. Developers are smart, let them decide by themselves. Put your efforts to make groovy not 100 times slower then java compiled code first please.</description>
 <pubDate>Sun, 03 Feb 2008 19:27:08 -0500</pubDate>
 <dc:creator>afsina</dc:creator>
 <guid isPermaLink="false">comment 559 at http://groovy.dzone.com</guid>
</item>
</channel>
</rss>
