<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Why I Love Closures</title>
	<atom:link href="http://joeygibson.com/2008/10/04/why-i-love-closures/feed/" rel="self" type="application/rss+xml" />
	<link>http://joeygibson.com/2008/10/04/why-i-love-closures/</link>
	<description>Java, Clojure, Scala, Groovy, Ruby, Python, Lisp, Objective-C, OSX, politics, religion, Koine Greek, Tae Kwon Do, Spanish and much more!</description>
	<lastBuildDate>Fri, 27 Jan 2012 16:22:41 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<item>
		<title>By: joeygibson</title>
		<link>http://joeygibson.com/2008/10/04/why-i-love-closures/comment-page-1/#comment-601</link>
		<dc:creator>joeygibson</dc:creator>
		<pubDate>Sat, 11 Oct 2008 14:39:21 +0000</pubDate>
		<guid isPermaLink="false">http://joeygibson.com/?p=824#comment-601</guid>
		<description>Jacob, you&#039;re still going to know exactly where the problem occurred. Any exception that is thrown will still have line numbers and anything else you&#039;d expect to find. There&#039;s no obfuscation of problem location.</description>
		<content:encoded><![CDATA[<p>Jacob, you&#8217;re still going to know exactly where the problem occurred. Any exception that is thrown will still have line numbers and anything else you&#8217;d expect to find. There&#8217;s no obfuscation of problem location.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jacob Nikom</title>
		<link>http://joeygibson.com/2008/10/04/why-i-love-closures/comment-page-1/#comment-600</link>
		<dc:creator>Jacob Nikom</dc:creator>
		<pubDate>Fri, 10 Oct 2008 23:15:50 +0000</pubDate>
		<guid isPermaLink="false">http://joeygibson.com/?p=824#comment-600</guid>
		<description>Hi,

I wonder what closure delivers when an error happened. In that Java example if something wrong happened when I am closing the connection, I know where it happened. Java will be able to report exact line number, because at minimum one statement corresponds to the particular action. With closure we have more actions than statements. Closure hides this clear correspondence from me by adding addition layer.

IMHO, it is better to have more lines of transparent code than fewer lines of obscure code.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I wonder what closure delivers when an error happened. In that Java example if something wrong happened when I am closing the connection, I know where it happened. Java will be able to report exact line number, because at minimum one statement corresponds to the particular action. With closure we have more actions than statements. Closure hides this clear correspondence from me by adding addition layer.</p>
<p>IMHO, it is better to have more lines of transparent code than fewer lines of obscure code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: joeygibson</title>
		<link>http://joeygibson.com/2008/10/04/why-i-love-closures/comment-page-1/#comment-598</link>
		<dc:creator>joeygibson</dc:creator>
		<pubDate>Thu, 09 Oct 2008 17:26:50 +0000</pubDate>
		<guid isPermaLink="false">http://joeygibson.com/?p=824#comment-598</guid>
		<description>Anthony, I see your point. I probably didn&#039;t make the case as clearly as I wanted. That comment was in response to someone who suggested using some features from a 3rd-party library. I was trying to say that the fact that the languages support closures allows you to do this sort of thing, without needing another library.</description>
		<content:encoded><![CDATA[<p>Anthony, I see your point. I probably didn&#8217;t make the case as clearly as I wanted. That comment was in response to someone who suggested using some features from a 3rd-party library. I was trying to say that the fact that the languages support closures allows you to do this sort of thing, without needing another library.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anthony Jayasekera</title>
		<link>http://joeygibson.com/2008/10/04/why-i-love-closures/comment-page-1/#comment-597</link>
		<dc:creator>Anthony Jayasekera</dc:creator>
		<pubDate>Thu, 09 Oct 2008 17:07:27 +0000</pubDate>
		<guid isPermaLink="false">http://joeygibson.com/?p=824#comment-597</guid>
		<description>&quot;My point was that Ruby and Groovy allow you to do cool things, because of what’s in the language and its library, out of the box.&quot;

That is not really an argument for closures though is it.</description>
		<content:encoded><![CDATA[<p>&#8220;My point was that Ruby and Groovy allow you to do cool things, because of what’s in the language and its library, out of the box.&#8221;</p>
<p>That is not really an argument for closures though is it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Randal L. Schwartz</title>
		<link>http://joeygibson.com/2008/10/04/why-i-love-closures/comment-page-1/#comment-596</link>
		<dc:creator>Randal L. Schwartz</dc:creator>
		<pubDate>Thu, 09 Oct 2008 15:59:36 +0000</pubDate>
		<guid isPermaLink="false">http://joeygibson.com/?p=824#comment-596</guid>
		<description>And of course, Perl has had closures since the beginning of Perl 5, which was back in the pre-Internet days (1995-ish).  There&#039;s even an entire book dedicated to Perl&#039;s closures... MJD&#039;s &quot;Higher Order Programming&quot;.  Perl: those who do not study it are doomed to reinvent it, badly.</description>
		<content:encoded><![CDATA[<p>And of course, Perl has had closures since the beginning of Perl 5, which was back in the pre-Internet days (1995-ish).  There&#8217;s even an entire book dedicated to Perl&#8217;s closures&#8230; MJD&#8217;s &#8220;Higher Order Programming&#8221;.  Perl: those who do not study it are doomed to reinvent it, badly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul King</title>
		<link>http://joeygibson.com/2008/10/04/why-i-love-closures/comment-page-1/#comment-595</link>
		<dc:creator>Paul King</dc:creator>
		<pubDate>Thu, 09 Oct 2008 11:47:11 +0000</pubDate>
		<guid isPermaLink="false">http://joeygibson.com/?p=824#comment-595</guid>
		<description>Oops, just checked the code again. My bad - I don&#039;t know what I was thinking the other day - I must have been suffering from more lack of sleep that normal that day. You and Gordópaz are correct. Resources are closed only if you are using DataSources even with connection or statement caching in place. Sorry about the confusion.</description>
		<content:encoded><![CDATA[<p>Oops, just checked the code again. My bad &#8211; I don&#8217;t know what I was thinking the other day &#8211; I must have been suffering from more lack of sleep that normal that day. You and Gordópaz are correct. Resources are closed only if you are using DataSources even with connection or statement caching in place. Sorry about the confusion.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gordópaz</title>
		<link>http://joeygibson.com/2008/10/04/why-i-love-closures/comment-page-1/#comment-590</link>
		<dc:creator>Gordópaz</dc:creator>
		<pubDate>Wed, 08 Oct 2008 18:58:33 +0000</pubDate>
		<guid isPermaLink="false">http://joeygibson.com/?p=824#comment-590</guid>
		<description>Re: “… I used the eachRow method …”

In Groovy, eachRow closes the resources ONLY if the connection provider is a DataSource. When the groovy.sql.Sql instance is created using a Connection instead of a DataSource, closing the connection is up to the calling code.</description>
		<content:encoded><![CDATA[<p>Re: “… I used the eachRow method …”</p>
<p>In Groovy, eachRow closes the resources ONLY if the connection provider is a DataSource. When the groovy.sql.Sql instance is created using a Connection instead of a DataSource, closing the connection is up to the calling code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul King</title>
		<link>http://joeygibson.com/2008/10/04/why-i-love-closures/comment-page-1/#comment-581</link>
		<dc:creator>Paul King</dc:creator>
		<pubDate>Mon, 06 Oct 2008 20:26:38 +0000</pubDate>
		<guid isPermaLink="false">http://joeygibson.com/?p=824#comment-581</guid>
		<description>By all means, consider a wrapper object if you think your circumstances require it, but JDBC drivers are pretty optimised these days. On top of which if you are using a pool, you will likely have some very good connection management going on. Then at least in 1.6-beta-1 and above you can always do sql.cacheStatements = true to turn on prepared statement caching within the Sql object (which implies connection caching) or alternatively use the cacheConnection() method which takes a closure and uses the same connection for all sql method calls within the closure. Some of this might not be documented well yet but hopefully will be before 1.6 final.</description>
		<content:encoded><![CDATA[<p>By all means, consider a wrapper object if you think your circumstances require it, but JDBC drivers are pretty optimised these days. On top of which if you are using a pool, you will likely have some very good connection management going on. Then at least in 1.6-beta-1 and above you can always do sql.cacheStatements = true to turn on prepared statement caching within the Sql object (which implies connection caching) or alternatively use the cacheConnection() method which takes a closure and uses the same connection for all sql method calls within the closure. Some of this might not be documented well yet but hopefully will be before 1.6 final.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: joeygibson</title>
		<link>http://joeygibson.com/2008/10/04/why-i-love-closures/comment-page-1/#comment-580</link>
		<dc:creator>joeygibson</dc:creator>
		<pubDate>Mon, 06 Oct 2008 16:50:37 +0000</pubDate>
		<guid isPermaLink="false">http://joeygibson.com/?p=824#comment-580</guid>
		<description>Paul, that actually seems like the wrong thing to do. What if I want to do several selects against the same connection? I&#039;ve actually written a wrapper for the Sql object that does what I want. I haven&#039;t fully tested it yet, but I was able to write the code in Groovy that looked almost just like the code in Ruby.</description>
		<content:encoded><![CDATA[<p>Paul, that actually seems like the wrong thing to do. What if I want to do several selects against the same connection? I&#8217;ve actually written a wrapper for the Sql object that does what I want. I haven&#8217;t fully tested it yet, but I was able to write the code in Groovy that looked almost just like the code in Ruby.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul King</title>
		<link>http://joeygibson.com/2008/10/04/why-i-love-closures/comment-page-1/#comment-579</link>
		<dc:creator>Paul King</dc:creator>
		<pubDate>Mon, 06 Oct 2008 13:34:56 +0000</pubDate>
		<guid isPermaLink="false">http://joeygibson.com/?p=824#comment-579</guid>
		<description>Re: &quot;... I used the eachRow method ...&quot;

Yes, just checked the source code and (at least in trunk) every variation of eachRow that I could find closes the resources. This may not be the case for very old versions of Groovy, not sure, but fisheye and svn have all of the history.

Cheers, Paul.</description>
		<content:encoded><![CDATA[<p>Re: &#8220;&#8230; I used the eachRow method &#8230;&#8221;</p>
<p>Yes, just checked the source code and (at least in trunk) every variation of eachRow that I could find closes the resources. This may not be the case for very old versions of Groovy, not sure, but fisheye and svn have all of the history.</p>
<p>Cheers, Paul.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

