<?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: F# vs C# vs Java: Functional Collection Parameters</title>
	<atom:link href="http://www.markhneedham.com/blog/2009/01/19/f-vs-c-vs-java-functional-collection-parameters/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.markhneedham.com/blog/2009/01/19/f-vs-c-vs-java-functional-collection-parameters/</link>
	<description>Thoughts on Software Development</description>
	<lastBuildDate>Sat, 11 Feb 2012 23:17:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Griff</title>
		<link>http://www.markhneedham.com/blog/2009/01/19/f-vs-c-vs-java-functional-collection-parameters/comment-page-1/#comment-60720</link>
		<dc:creator>Griff</dc:creator>
		<pubDate>Mon, 08 Nov 2010 10:51:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=860#comment-60720</guid>
		<description>As ever when looking at these code comparisons, I find myself thinking
- when a good optimising compiler has finished, are these really that different ?
- is writing an extremely terse single line of code actually that clever in the long term if you need
  - other people to understand it
  - to look at intermediate values when debugging
  - to assert/test valid values of the input array</description>
		<content:encoded><![CDATA[<p>As ever when looking at these code comparisons, I find myself thinking<br />
- when a good optimising compiler has finished, are these really that different ?<br />
- is writing an extremely terse single line of code actually that clever in the long term if you need<br />
  &#8211; other people to understand it<br />
  &#8211; to look at intermediate values when debugging<br />
  &#8211; to assert/test valid values of the input array</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jose Ayerdis</title>
		<link>http://www.markhneedham.com/blog/2009/01/19/f-vs-c-vs-java-functional-collection-parameters/comment-page-1/#comment-55104</link>
		<dc:creator>Jose Ayerdis</dc:creator>
		<pubDate>Sat, 16 Oct 2010 06:12:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=860#comment-55104</guid>
		<description>Would have been nice if you use the same structure and did not create a Java version if you are not high experienced on it.</description>
		<content:encoded><![CDATA[<p>Would have been nice if you use the same structure and did not create a Java version if you are not high experienced on it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: xx</title>
		<link>http://www.markhneedham.com/blog/2009/01/19/f-vs-c-vs-java-functional-collection-parameters/comment-page-1/#comment-49902</link>
		<dc:creator>xx</dc:creator>
		<pubDate>Thu, 16 Sep 2010 14:41:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=860#comment-49902</guid>
		<description>You put too much unnecessary code for java version

int[] xs = {1,2,3,4,5};
for (int x : xs) 
    System.out.println(x*x);</description>
		<content:encoded><![CDATA[<p>You put too much unnecessary code for java version</p>
<p>int[] xs = {1,2,3,4,5};<br />
for (int x : xs)<br />
    System.out.println(x*x);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Harrop</title>
		<link>http://www.markhneedham.com/blog/2009/01/19/f-vs-c-vs-java-functional-collection-parameters/comment-page-1/#comment-38534</link>
		<dc:creator>Jon Harrop</dc:creator>
		<pubDate>Sat, 05 Jun 2010 09:20:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=860#comment-38534</guid>
		<description>What is the Java equivalent of Array.Parallel.init in F#? I&#039;ll wager its absolutely *huge* because none of the infrastructure is there.</description>
		<content:encoded><![CDATA[<p>What is the Java equivalent of Array.Parallel.init in F#? I&#8217;ll wager its absolutely *huge* because none of the infrastructure is there.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: A</title>
		<link>http://www.markhneedham.com/blog/2009/01/19/f-vs-c-vs-java-functional-collection-parameters/comment-page-1/#comment-24428</link>
		<dc:creator>A</dc:creator>
		<pubDate>Thu, 15 Oct 2009 08:21:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=860#comment-24428</guid>
		<description>Please don&#039;t confuse people by using vastly different data structures in your example. Java uses an array, C# a doubly-linked list, and F# a singly-list list. Use the same data structure, say array.

F#:

[&#124; 1..5 &#124;] &#124;&gt; Array.map (fun x -&gt; x * x) &#124;&gt; Array.iter (printfn &quot;%i&quot;)</description>
		<content:encoded><![CDATA[<p>Please don&#8217;t confuse people by using vastly different data structures in your example. Java uses an array, C# a doubly-linked list, and F# a singly-list list. Use the same data structure, say array.</p>
<p>F#:</p>
<p>[| 1..5 |] |&gt; Array.map (fun x -&gt; x * x) |&gt; Array.iter (printfn &#8220;%i&#8221;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Hunger</title>
		<link>http://www.markhneedham.com/blog/2009/01/19/f-vs-c-vs-java-functional-collection-parameters/comment-page-1/#comment-15667</link>
		<dc:creator>Michael Hunger</dc:creator>
		<pubDate>Thu, 30 Apr 2009 00:15:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=860#comment-15667</guid>
		<description>The problem with the java version is that they don&#039;t are functional style. As your f() method does printing the stuff it is just doing a side-effect and not collecting / filtering values.

I&#039;d rather write those examples as gathering values in a list / colleciton / enumeration / sequence (lazy). (as you stated in your first paragraph on map). That would be much more interesting because the java version for that is much more noisy than the oder languages:

int[] numbers = { 1,2,3,4,5};
Collection result=new ArrayList(5);
for (int number : numbers) {
    result.add(f(number));
}
 
private int f(int value) {
    return value*value;
}

Here the groovy version for map:

1.upto(5).collect{ it*it }
and clojure
(map #(* % %) (range 1 5))

THAT&#039;s concise :)

If you want to print it directly:
groovy: 1.upto(5).each{ println it*it }
clojure: (map #(println (* % %)) (range 1 5))

Cheers Michael</description>
		<content:encoded><![CDATA[<p>The problem with the java version is that they don&#8217;t are functional style. As your f() method does printing the stuff it is just doing a side-effect and not collecting / filtering values.</p>
<p>I&#8217;d rather write those examples as gathering values in a list / colleciton / enumeration / sequence (lazy). (as you stated in your first paragraph on map). That would be much more interesting because the java version for that is much more noisy than the oder languages:</p>
<p>int[] numbers = { 1,2,3,4,5};<br />
Collection result=new ArrayList(5);<br />
for (int number : numbers) {<br />
    result.add(f(number));<br />
}</p>
<p>private int f(int value) {<br />
    return value*value;<br />
}</p>
<p>Here the groovy version for map:</p>
<p>1.upto(5).collect{ it*it }<br />
and clojure<br />
(map #(* % %) (range 1 5))</p>
<p>THAT&#8217;s concise <img src='http://www.markhneedham.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>If you want to print it directly:<br />
groovy: 1.upto(5).each{ println it*it }<br />
clojure: (map #(println (* % %)) (range 1 5))</p>
<p>Cheers Michael</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rick Minerich's Development Wonderland : Discoveries This Week 01/30/2009</title>
		<link>http://www.markhneedham.com/blog/2009/01/19/f-vs-c-vs-java-functional-collection-parameters/comment-page-1/#comment-6630</link>
		<dc:creator>Rick Minerich's Development Wonderland : Discoveries This Week 01/30/2009</dc:creator>
		<pubDate>Fri, 30 Jan 2009 19:47:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=860#comment-6630</guid>
		<description>[...] Blog - Mark Needham’s F# vs C# vs Java: Collection Parameters [...]</description>
		<content:encoded><![CDATA[<p>[...] Blog &#8211; Mark Needham’s F# vs C# vs Java: Collection Parameters [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ruby, Ruby, Ruby! &#124; lucastex.com</title>
		<link>http://www.markhneedham.com/blog/2009/01/19/f-vs-c-vs-java-functional-collection-parameters/comment-page-1/#comment-5767</link>
		<dc:creator>Ruby, Ruby, Ruby! &#124; lucastex.com</dc:creator>
		<pubDate>Tue, 27 Jan 2009 17:14:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=860#comment-5767</guid>
		<description>[...] O post do Paulo que eu li, apesar de também estar no blog dele do link acima, foi lido no Blog do RASEA (um projeto OpenSource que ele toca com alguns amigos) e está aqui. Já o post original com os exemplos iniciais, está aqui. [...]</description>
		<content:encoded><![CDATA[<p>[...] O post do Paulo que eu li, apesar de também estar no blog dele do link acima, foi lido no Blog do RASEA (um projeto OpenSource que ele toca com alguns amigos) e está aqui. Já o post original com os exemplos iniciais, está aqui. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paulo Suzart</title>
		<link>http://www.markhneedham.com/blog/2009/01/19/f-vs-c-vs-java-functional-collection-parameters/comment-page-1/#comment-4749</link>
		<dc:creator>Paulo Suzart</dc:creator>
		<pubDate>Thu, 22 Jan 2009 19:11:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=860#comment-4749</guid>
		<description>Hi Mark, I´ve added some comparation to Scala. Try http://raseablog.blogspot.com/2009/01/scala-scala-scala.html to see. It would be very nice to receive your visit.
Thanks and congratulations for the simple, but very straight nice post.</description>
		<content:encoded><![CDATA[<p>Hi Mark, I´ve added some comparation to Scala. Try <a href="http://raseablog.blogspot.com/2009/01/scala-scala-scala.html" rel="nofollow">http://raseablog.blogspot.com/2009/01/scala-scala-scala.html</a> to see. It would be very nice to receive your visit.<br />
Thanks and congratulations for the simple, but very straight nice post.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scala, Scala, Scala &#171; Codemountain</title>
		<link>http://www.markhneedham.com/blog/2009/01/19/f-vs-c-vs-java-functional-collection-parameters/comment-page-1/#comment-4745</link>
		<dc:creator>Scala, Scala, Scala &#171; Codemountain</dc:creator>
		<pubDate>Thu, 22 Jan 2009 18:45:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=860#comment-4745</guid>
		<description>[...] in Java &#124; Tags: scala &#124; by paulosuzart    Estava eu vagando pelo meu Google Reader, e encontrei este post falando sobre uma comparação  &#8221;for fun&#8221; entra Java, C# e F# em alguns aspectos [...]</description>
		<content:encoded><![CDATA[<p>[...] in Java | Tags: scala | by paulosuzart    Estava eu vagando pelo meu Google Reader, e encontrei este post falando sobre uma comparação  &#8221;for fun&#8221; entra Java, C# e F# em alguns aspectos [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

