<?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"
	>
<channel>
	<title>Comments on: Closures And The Ars Rhetorica</title>
	<atom:link href="http://www.blog.dannynet.net/archives/99/feed" rel="self" type="application/rss+xml" />
	<link>http://www.blog.dannynet.net/archives/99</link>
	<description>Pondering Programming and Poetry</description>
	<pubDate>Sat, 04 Feb 2012 22:53:50 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
		<item>
		<title>By: Trudi Poplar</title>
		<link>http://www.blog.dannynet.net/archives/99#comment-244832</link>
		<dc:creator>Trudi Poplar</dc:creator>
		<pubDate>Tue, 26 Oct 2010 05:28:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.blog.dannynet.net/archives/99#comment-244832</guid>
		<description>@admin: I just have to say your website is the first I've come across this morning that doesn't have spelling errors every other sentence. Thanks for taking the time to construct something that doesn't look like a 5th grader wrote. I apologize, just had to vent.</description>
		<content:encoded><![CDATA[<p>@admin: I just have to say your website is the first I&#8217;ve come across this morning that doesn&#8217;t have spelling errors every other sentence. Thanks for taking the time to construct something that doesn&#8217;t look like a 5th grader wrote. I apologize, just had to vent.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Neal Gafter</title>
		<link>http://www.blog.dannynet.net/archives/99#comment-129778</link>
		<dc:creator>Neal Gafter</dc:creator>
		<pubDate>Tue, 15 Apr 2008 22:05:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.blog.dannynet.net/archives/99#comment-129778</guid>
		<description>For some obscure annotations code, the compiler test suite has some doozies

@T(a=3, b=@D(12))
@U(@T(a=14, b=@D()))
class X {
}</description>
		<content:encoded><![CDATA[<p>For some obscure annotations code, the compiler test suite has some doozies</p>
<p>@T(a=3, b=@D(12))<br />
@U(@T(a=14, b=@D()))<br />
class X {<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephan Schmidt</title>
		<link>http://www.blog.dannynet.net/archives/99#comment-103153</link>
		<dc:creator>Stephan Schmidt</dc:creator>
		<pubDate>Wed, 02 Jan 2008 09:57:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.blog.dannynet.net/archives/99#comment-103153</guid>
		<description>Wouldn't the non-closure Java example look like this:
&lt;pre class="code"&gt;
new TransactionTemplate() {
    protected void withTransaction(EntityManager em) {
       Person p = new Person("Last name");
       entityManager.persist(p);
    })
}
 .execute();
&lt;/pre&gt;
or with CICE:
&lt;pre class="code"&gt;
new TransactionTemplate(EntityManager em) {
       Person p = new Person("Last name");
       entityManager.persist(p);
}
 .execute();
&lt;/pre&gt;

There are arguments for closures in Java, resource management clearly isn't.

Peace
-stephan

-- 
Stephan Schmidt :: stephan@reposita.org
Reposita Open Source - Monitor your software development
http://www.reposita.org 
Blog at http://stephan.reposita.org - No signal. No noise.</description>
		<content:encoded><![CDATA[<p>Wouldn&#8217;t the non-closure Java example look like this:</p>
<pre class="code">
new TransactionTemplate() {
    protected void withTransaction(EntityManager em) {
       Person p = new Person("Last name");
       entityManager.persist(p);
    })
}
 .execute();
</pre>
<p>or with CICE:</p>
<pre class="code">
new TransactionTemplate(EntityManager em) {
       Person p = new Person("Last name");
       entityManager.persist(p);
}
 .execute();
</pre>
<p>There are arguments for closures in Java, resource management clearly isn&#8217;t.</p>
<p>Peace<br />
-stephan</p>
<p>&#8211;<br />
Stephan Schmidt :: <a href="mailto:stephan@reposita.org">stephan@reposita.org</a><br />
Reposita Open Source - Monitor your software development<br />
<a href="http://www.reposita.org" rel="nofollow">http://www.reposita.org</a><br />
Blog at <a href="http://stephan.reposita.org" rel="nofollow">http://stephan.reposita.org</a> - No signal. No noise.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Danny</title>
		<link>http://www.blog.dannynet.net/archives/99#comment-101937</link>
		<dc:creator>Danny</dc:creator>
		<pubDate>Thu, 27 Dec 2007 15:36:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.blog.dannynet.net/archives/99#comment-101937</guid>
		<description>Erik, I left a reply on &lt;a href="http://day-to-day-stuff.blogspot.com/2007/12/demise-of-java-long-live-jvm.html" rel="nofollow"&gt;your blog&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>Erik, I left a reply on <a href="http://day-to-day-stuff.blogspot.com/2007/12/demise-of-java-long-live-jvm.html" rel="nofollow">your blog</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Danny</title>
		<link>http://www.blog.dannynet.net/archives/99#comment-101395</link>
		<dc:creator>Danny</dc:creator>
		<pubDate>Mon, 24 Dec 2007 18:24:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.blog.dannynet.net/archives/99#comment-101395</guid>
		<description>Josh,

Thank you for your detailed clarification. I wanted to show that, even for existing (and by now well-accepted) language features, statements can be found on the Internet about how scary and dangerous these features can be; and that code can be written using these features that may seem inscrutable at first sight (especially if we're talking about new features) (and any code ripped from its context and put on a slide may seem inscrutable to us but make perfect sense to the people writing and using it). In my opinion, arguments like these should not be used to discuss new language features.

I mean, you could have come on stage and presented your own proposal, showing its strengths and weaknesses, demonstrating its usefulness in various use cases. Much like Neal Gafter did last year. Instead, you chose to start with a full-blown attack on the BGGA proposal, introducing it with two random quotations (from people the audience would identify with), followed by showing some of its most complex examples. I'm certainly not accusing you of trickery, but if you were out to make a nicely constructed plea to the audience against the BGGA proposal, you couldn't have done much better.

Finally, I hope you'll agree that "the feel of Java" is a subjective notion. The BGGA proposal has been around for more than a year, and by now, the syntax does not feel alien or un-Java-like to me. I will gladly put up with the dangers and risks you're talking about--not just to be able to use closures today, but to see a future far beyond where Java will not be left behind as a 'dead language'.</description>
		<content:encoded><![CDATA[<p>Josh,</p>
<p>Thank you for your detailed clarification. I wanted to show that, even for existing (and by now well-accepted) language features, statements can be found on the Internet about how scary and dangerous these features can be; and that code can be written using these features that may seem inscrutable at first sight (especially if we&#8217;re talking about new features) (and any code ripped from its context and put on a slide may seem inscrutable to us but make perfect sense to the people writing and using it). In my opinion, arguments like these should not be used to discuss new language features.</p>
<p>I mean, you could have come on stage and presented your own proposal, showing its strengths and weaknesses, demonstrating its usefulness in various use cases. Much like Neal Gafter did last year. Instead, you chose to start with a full-blown attack on the BGGA proposal, introducing it with two random quotations (from people the audience would identify with), followed by showing some of its most complex examples. I&#8217;m certainly not accusing you of trickery, but if you were out to make a nicely constructed plea to the audience against the BGGA proposal, you couldn&#8217;t have done much better.</p>
<p>Finally, I hope you&#8217;ll agree that &#8220;the feel of Java&#8221; is a subjective notion. The BGGA proposal has been around for more than a year, and by now, the syntax does not feel alien or un-Java-like to me. I will gladly put up with the dangers and risks you&#8217;re talking about&#8211;not just to be able to use closures today, but to see a future far beyond where Java will not be left behind as a &#8216;dead language&#8217;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Erik van Oosten</title>
		<link>http://www.blog.dannynet.net/archives/99#comment-101356</link>
		<dc:creator>Erik van Oosten</dc:creator>
		<pubDate>Mon, 24 Dec 2007 10:19:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.blog.dannynet.net/archives/99#comment-101356</guid>
		<description>Contrary to what you might think, I do not think Java is dead (nor did I say so). I agree completely that Java should not be left alone just like that. There is too much experience and available stuff that you do not want to leave behind. At the same time I do not agree that Java can be extended over time. Extending a language is a very hard thing to do; the rigid syntax of Java is no longer up to it (except maybe some small things). This is the reason I promoted Scala in my article: keep all the good Java stuff /and/ move on to newer language constructs.</description>
		<content:encoded><![CDATA[<p>Contrary to what you might think, I do not think Java is dead (nor did I say so). I agree completely that Java should not be left alone just like that. There is too much experience and available stuff that you do not want to leave behind. At the same time I do not agree that Java can be extended over time. Extending a language is a very hard thing to do; the rigid syntax of Java is no longer up to it (except maybe some small things). This is the reason I promoted Scala in my article: keep all the good Java stuff /and/ move on to newer language constructs.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh Bloch</title>
		<link>http://www.blog.dannynet.net/archives/99#comment-101348</link>
		<dc:creator>Josh Bloch</dc:creator>
		<pubDate>Mon, 24 Dec 2007 07:38:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.blog.dannynet.net/archives/99#comment-101348</guid>
		<description>Danny,

You said:

"Of course I’m not serious here. Josh Bloch however, was very serious when he used the exact same arguments against the BGGA closure proposal, in his presentation at JavaPolis the other week."

I did not use "the exact same arguments."  You used intentionally obfuscated code and you didn't provide its provenance.  My code examples were not written with intent to obfuscate and their sources were clearly identified:  The inscrutable code on slide 30 was test code that comes with the closures prototype. The equally inscrutable code on slide 31 came from Mark Mahieu's blog, and was endorsed on Neal Gafter's blog.

The unexpected interactions on slide 33 came from my attempts to use the facility to do some very simple things. The examples on slides 36, 38, and 43 (which I composed) appear straightforward but  their appearance belies their behavior.  They are, essentially, puzzlers, demonstrating real hazards of the BGGA closures facility as it is currently specified (v0.5).

So I reject your charge of rhetorical trickery.  The dangers I discussed are real. Not just unintentional non-local transfer of control and erroneous access to local variables, but the serious risk of harm to the readability of Java code and learnability of the language--of harm to "the feel of Java."  Yes, it's possible to write nice little examples with BGGA closures, but I suspect that practical uses would have a character more like the code contained in my talk.

         Josh</description>
		<content:encoded><![CDATA[<p>Danny,</p>
<p>You said:</p>
<p>&#8220;Of course I’m not serious here. Josh Bloch however, was very serious when he used the exact same arguments against the BGGA closure proposal, in his presentation at JavaPolis the other week.&#8221;</p>
<p>I did not use &#8220;the exact same arguments.&#8221;  You used intentionally obfuscated code and you didn&#8217;t provide its provenance.  My code examples were not written with intent to obfuscate and their sources were clearly identified:  The inscrutable code on slide 30 was test code that comes with the closures prototype. The equally inscrutable code on slide 31 came from Mark Mahieu&#8217;s blog, and was endorsed on Neal Gafter&#8217;s blog.</p>
<p>The unexpected interactions on slide 33 came from my attempts to use the facility to do some very simple things. The examples on slides 36, 38, and 43 (which I composed) appear straightforward but  their appearance belies their behavior.  They are, essentially, puzzlers, demonstrating real hazards of the BGGA closures facility as it is currently specified (v0.5).</p>
<p>So I reject your charge of rhetorical trickery.  The dangers I discussed are real. Not just unintentional non-local transfer of control and erroneous access to local variables, but the serious risk of harm to the readability of Java code and learnability of the language&#8211;of harm to &#8220;the feel of Java.&#8221;  Yes, it&#8217;s possible to write nice little examples with BGGA closures, but I suspect that practical uses would have a character more like the code contained in my talk.</p>
<p>         Josh</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Danny</title>
		<link>http://www.blog.dannynet.net/archives/99#comment-101346</link>
		<dc:creator>Danny</dc:creator>
		<pubDate>Mon, 24 Dec 2007 07:12:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.blog.dannynet.net/archives/99#comment-101346</guid>
		<description>@p3t0r: "without having to modify the syntax"? The abuse of existing keywords (try and protected) is one of the reasons I dislike the CICE proposal.

But my point was primarily to show the fallacies in Bloch's argument. I added the code as an example of how most closures you'll encounter in everyday coding will make your code simpler, not more complex--even when following the BGGA proposal.</description>
		<content:encoded><![CDATA[<p>@p3t0r: &#8220;without having to modify the syntax&#8221;? The abuse of existing keywords (try and protected) is one of the reasons I dislike the CICE proposal.</p>
<p>But my point was primarily to show the fallacies in Bloch&#8217;s argument. I added the code as an example of how most closures you&#8217;ll encounter in everyday coding will make your code simpler, not more complex&#8211;even when following the BGGA proposal.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: p3t0r</title>
		<link>http://www.blog.dannynet.net/archives/99#comment-101253</link>
		<dc:creator>p3t0r</dc:creator>
		<pubDate>Sun, 23 Dec 2007 18:01:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.blog.dannynet.net/archives/99#comment-101253</guid>
		<description>Your transaction example might not be the best way to debunk Joshs' arguments... Josh does want to add ARM (automatic resource management) blocks to Java (see &lt;a href="http://docs.google.com/View?docid=dffxznxr_1nmsqkz" rel="nofollow"&gt;here&lt;/a&gt;), which would allow you to do something like this:


   try (entityManager.getTransaction()) {
       ... // Perform action transactionally
   } catch(AbortException e) {
       ...
   }


Without having the modify the Java syntax to heavily. 

Personally I was a bit worried about the non-local return problems which Josh sketched, but mr. Gafter managed to convince me Josh 'overlooked' the implicit use of the RestrictedInterface for function types or closers defined using the =&#62; sign (see &lt;a href="http://maas-frensch.com/peter/2007/12/21/closures-and-the-return-of-the-return/" rel="nofollow"&gt;here&lt;/a&gt;).</description>
		<content:encoded><![CDATA[<p>Your transaction example might not be the best way to debunk Joshs&#8217; arguments&#8230; Josh does want to add ARM (automatic resource management) blocks to Java (see <a href="http://docs.google.com/View?docid=dffxznxr_1nmsqkz" rel="nofollow">here</a>), which would allow you to do something like this:</p>
<p>   try (entityManager.getTransaction()) {<br />
       &#8230; // Perform action transactionally<br />
   } catch(AbortException e) {<br />
       &#8230;<br />
   }</p>
<p>Without having the modify the Java syntax to heavily. </p>
<p>Personally I was a bit worried about the non-local return problems which Josh sketched, but mr. Gafter managed to convince me Josh &#8216;overlooked&#8217; the implicit use of the RestrictedInterface for function types or closers defined using the =&gt; sign (see <a href="http://maas-frensch.com/peter/2007/12/21/closures-and-the-return-of-the-return/" rel="nofollow">here</a>).</p>
]]></content:encoded>
	</item>
</channel>
</rss>

