<?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: Anatomy of a Flawed Clojure vs. Scala LOC Comparison</title>
	<atom:link href="http://codemonkeyism.com/scala-vs-clojure-flawed-loc-comparison/feed/" rel="self" type="application/rss+xml" />
	<link>http://codemonkeyism.com/scala-vs-clojure-flawed-loc-comparison/</link>
	<description></description>
	<lastBuildDate>Wed, 09 May 2012 22:39:34 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Towards better quantitative marketing &#171; DECISION STATS</title>
		<link>http://codemonkeyism.com/scala-vs-clojure-flawed-loc-comparison/comment-page-1/#comment-380482</link>
		<dc:creator>Towards better quantitative marketing &#171; DECISION STATS</dc:creator>
		<pubDate>Tue, 14 Dec 2010 17:45:19 +0000</pubDate>
		<guid isPermaLink="false">http://codemonkeyism.com/?p=1408#comment-380482</guid>
		<description>[...] Anatomy of a Flawed Clojure vs. Scala LOC Comparison (codemonkeyism.com) [...]</description>
		<content:encoded><![CDATA[<p>[...] Anatomy of a Flawed Clojure vs. Scala LOC Comparison (codemonkeyism.com) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ken Egervari</title>
		<link>http://codemonkeyism.com/scala-vs-clojure-flawed-loc-comparison/comment-page-1/#comment-347064</link>
		<dc:creator>Ken Egervari</dc:creator>
		<pubDate>Fri, 22 Oct 2010 19:27:23 +0000</pubDate>
		<guid isPermaLink="false">http://codemonkeyism.com/?p=1408#comment-347064</guid>
		<description>That scala is awful though. The reason it&#039;s 50+ lines of code is that it&#039;s written in a very un-scala-like fashion. It was written like a Java program.

Such a program that wasn&#039;t written the way the language designers intended is not a fair comparison at all.

For example, here&#039;s some code that not only reads all the text from a file, it also skips comments that start with a #. It&#039;s pretty damn easy to understand, and it&#039;s concise:

val text = Source.fromFile(&quot;somefile.dat&quot;)
    .getLines
    .filterNot(_.startsWith(&quot;#&quot;))
    .mkString</description>
		<content:encoded><![CDATA[<p>That scala is awful though. The reason it&#8217;s 50+ lines of code is that it&#8217;s written in a very un-scala-like fashion. It was written like a Java program.</p>
<p>Such a program that wasn&#8217;t written the way the language designers intended is not a fair comparison at all.</p>
<p>For example, here&#8217;s some code that not only reads all the text from a file, it also skips comments that start with a #. It&#8217;s pretty damn easy to understand, and it&#8217;s concise:</p>
<p>val text = Source.fromFile(&#8220;somefile.dat&#8221;)<br />
    .getLines<br />
    .filterNot(_.startsWith(&#8220;#&#8221;))<br />
    .mkString</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stephan</title>
		<link>http://codemonkeyism.com/scala-vs-clojure-flawed-loc-comparison/comment-page-1/#comment-264421</link>
		<dc:creator>stephan</dc:creator>
		<pubDate>Tue, 12 Jan 2010 11:31:57 +0000</pubDate>
		<guid isPermaLink="false">http://codemonkeyism.com/?p=1408#comment-264421</guid>
		<description>@Marek: As the author did the same (with Python and Java) several times and didn&#039;t improve his comparisons, made the same errors over and over though, I do no longer believe it&#039;s accidental.</description>
		<content:encoded><![CDATA[<p>@Marek: As the author did the same (with Python and Java) several times and didn&#8217;t improve his comparisons, made the same errors over and over though, I do no longer believe it&#8217;s accidental.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marek Krajewski</title>
		<link>http://codemonkeyism.com/scala-vs-clojure-flawed-loc-comparison/comment-page-1/#comment-264382</link>
		<dc:creator>Marek Krajewski</dc:creator>
		<pubDate>Tue, 12 Jan 2010 09:37:53 +0000</pubDate>
		<guid isPermaLink="false">http://codemonkeyism.com/?p=1408#comment-264382</guid>
		<description>Like Nene I think FUD is a little too strong a name here, but I think it could pass under &quot;licentia poetica&quot; here :-).

But seriuosly, I think Clojure will be compulsorily less verbose than Scala, as Scala is a statically typed language and Clojure isn&#039;t, so you&#039;d sometimes need explicit type annotations. Moreover, Scala has all the OO-bagage and Clojure doesn&#039;t. But all that isn&#039;t relevant when comparing languages, this are 2 diffrent ideas about how to leverage Java infrastructure and they are both interesting. 

Which said, I like Clojure better...</description>
		<content:encoded><![CDATA[<p>Like Nene I think FUD is a little too strong a name here, but I think it could pass under &#8220;licentia poetica&#8221; here :-).</p>
<p>But seriuosly, I think Clojure will be compulsorily less verbose than Scala, as Scala is a statically typed language and Clojure isn&#8217;t, so you&#8217;d sometimes need explicit type annotations. Moreover, Scala has all the OO-bagage and Clojure doesn&#8217;t. But all that isn&#8217;t relevant when comparing languages, this are 2 diffrent ideas about how to leverage Java infrastructure and they are both interesting. </p>
<p>Which said, I like Clojure better&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Concise python code &#124; /var/log/mind</title>
		<link>http://codemonkeyism.com/scala-vs-clojure-flawed-loc-comparison/comment-page-1/#comment-262624</link>
		<dc:creator>Concise python code &#124; /var/log/mind</dc:creator>
		<pubDate>Tue, 05 Jan 2010 20:56:17 +0000</pubDate>
		<guid isPermaLink="false">http://codemonkeyism.com/?p=1408#comment-262624</guid>
		<description>[...] There is another nice post by Stephan Schmidt &#8211; Anatomy of a Flawed Clojure vs. Scala LOC Comparison which does reflect an opinion in the context of Scala and a post authored on the same blog as the [...]</description>
		<content:encoded><![CDATA[<p>[...] There is another nice post by Stephan Schmidt &#8211; Anatomy of a Flawed Clojure vs. Scala LOC Comparison which does reflect an opinion in the context of Scala and a post authored on the same blog as the [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stephan</title>
		<link>http://codemonkeyism.com/scala-vs-clojure-flawed-loc-comparison/comment-page-1/#comment-262491</link>
		<dc:creator>stephan</dc:creator>
		<pubDate>Tue, 05 Jan 2010 08:42:03 +0000</pubDate>
		<guid isPermaLink="false">http://codemonkeyism.com/?p=1408#comment-262491</guid>
		<description>@Nene: Thanks, good insights.

I also think LOCs are important. I hope we will learn more about different languages, apply more scientific rigor and learn how to interpret facts and results (e.g. how less lines of code lead - perhaps - to denser lines which are - perhaps - less readable. Though K advocates claim to just &quot;sense&quot; the code from looking at it).

But this would start with an honest will to find the best example in each language, not makeing the &quot;other&quot; language look delibertly worse. 

And I&#039;d call that FUD - it seems I have lower standards than you :-)</description>
		<content:encoded><![CDATA[<p>@Nene: Thanks, good insights.</p>
<p>I also think LOCs are important. I hope we will learn more about different languages, apply more scientific rigor and learn how to interpret facts and results (e.g. how less lines of code lead &#8211; perhaps &#8211; to denser lines which are &#8211; perhaps &#8211; less readable. Though K advocates claim to just &#8220;sense&#8221; the code from looking at it).</p>
<p>But this would start with an honest will to find the best example in each language, not makeing the &#8220;other&#8221; language look delibertly worse. </p>
<p>And I&#8217;d call that FUD &#8211; it seems I have lower standards than you :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dhananjay Nene</title>
		<link>http://codemonkeyism.com/scala-vs-clojure-flawed-loc-comparison/comment-page-1/#comment-262410</link>
		<dc:creator>Dhananjay Nene</dc:creator>
		<pubDate>Tue, 05 Jan 2010 01:25:04 +0000</pubDate>
		<guid isPermaLink="false">http://codemonkeyism.com/?p=1408#comment-262410</guid>
		<description>I think that the point well made in this post is that comparisons using LOC better be made with a clear focus on keeping it an apples to apples comparison to the extent possible, and with an injection of an reasonably equal level of capability in writing both (or all) versions of code.

I agree the comparison is flawed. However I am not sure if it tantamounts to FUD. Perhaps in my mind the threshold for getting that moniker is a little higher. I suspect I would look for some clear, deliberate sales pitch or alternatively an unnecessarily defensive approach or picking on some really silly unimportant issues for me to feel comfortable with calling it FUD.

I did look up other articles and there&#039;s some evidence of similar flaws in there as well. eg. &lt;a href=&quot;http://www.bestinclass.dk/index.php/2009/10/python-vs-clojure-reloaded/&quot; rel=&quot;nofollow&quot;&gt;Python vs Clojure – Reloaded&lt;/a&gt;. If you take a look at the #3 Top Rank per group example, it talks of 12 lines of python to 6 lines of clojure, yet another link in the comments http://gist.github.com/214369 shows an alternative implementation in 6 lines with excellent readability. Just to push the envelope I was able to implement exactly the same solution in exactly 1 line with atrocious readability.

I think some of the programming styles require a substantial tradeoffs between readibility and brevity. Moreover writing concise code with high readability may often require a substantial skill and even awareness of the language libraries and ecosystem, a capability the person conducting the analysis may not be equally blessed with in various languages. 

I think LOCs are important. Perhaps one needs to be very careful about using results of such comparisons, unless the results are consistently observed across many different code samples and across different programmers.</description>
		<content:encoded><![CDATA[<p>I think that the point well made in this post is that comparisons using LOC better be made with a clear focus on keeping it an apples to apples comparison to the extent possible, and with an injection of an reasonably equal level of capability in writing both (or all) versions of code.</p>
<p>I agree the comparison is flawed. However I am not sure if it tantamounts to FUD. Perhaps in my mind the threshold for getting that moniker is a little higher. I suspect I would look for some clear, deliberate sales pitch or alternatively an unnecessarily defensive approach or picking on some really silly unimportant issues for me to feel comfortable with calling it FUD.</p>
<p>I did look up other articles and there&#8217;s some evidence of similar flaws in there as well. eg. <a href="http://www.bestinclass.dk/index.php/2009/10/python-vs-clojure-reloaded/" rel="nofollow">Python vs Clojure – Reloaded</a>. If you take a look at the #3 Top Rank per group example, it talks of 12 lines of python to 6 lines of clojure, yet another link in the comments <a href="http://gist.github.com/214369" rel="nofollow">http://gist.github.com/214369</a> shows an alternative implementation in 6 lines with excellent readability. Just to push the envelope I was able to implement exactly the same solution in exactly 1 line with atrocious readability.</p>
<p>I think some of the programming styles require a substantial tradeoffs between readibility and brevity. Moreover writing concise code with high readability may often require a substantial skill and even awareness of the language libraries and ecosystem, a capability the person conducting the analysis may not be equally blessed with in various languages. </p>
<p>I think LOCs are important. Perhaps one needs to be very careful about using results of such comparisons, unless the results are consistently observed across many different code samples and across different programmers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zach Cox</title>
		<link>http://codemonkeyism.com/scala-vs-clojure-flawed-loc-comparison/comment-page-1/#comment-262342</link>
		<dc:creator>Zach Cox</dc:creator>
		<pubDate>Mon, 04 Jan 2010 20:11:25 +0000</pubDate>
		<guid isPermaLink="false">http://codemonkeyism.com/?p=1408#comment-262342</guid>
		<description>When I originally wrote that Scala version, I tried using:

scala.io.Source.fromFile(file).mkString

but got java.nio.BufferUnderflowExceptions, I guess due to Source.DefaultBufSize=2048 maybe?  But specifying the character encoding does seem to work:

scala.io.Source.fromFile(file, &quot;ISO-8859-1&quot;).mkString

So knock a few more off the Scala LoC count. :)</description>
		<content:encoded><![CDATA[<p>When I originally wrote that Scala version, I tried using:</p>
<p>scala.io.Source.fromFile(file).mkString</p>
<p>but got java.nio.BufferUnderflowExceptions, I guess due to Source.DefaultBufSize=2048 maybe?  But specifying the character encoding does seem to work:</p>
<p>scala.io.Source.fromFile(file, &#8220;ISO-8859-1&#8243;).mkString</p>
<p>So knock a few more off the Scala LoC count. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stephan</title>
		<link>http://codemonkeyism.com/scala-vs-clojure-flawed-loc-comparison/comment-page-1/#comment-262304</link>
		<dc:creator>stephan</dc:creator>
		<pubDate>Mon, 04 Jan 2010 17:28:35 +0000</pubDate>
		<guid isPermaLink="false">http://codemonkeyism.com/?p=1408#comment-262304</guid>
		<description>As said, Scala.io reads a file into a String (via mkString) vs. file2String :-) 

Lau hasn&#039;t been so restricted, 

&quot;(note: spit and slurp* are from contrib.duck-streams and str-join are from str-utils)&quot;</description>
		<content:encoded><![CDATA[<p>As said, Scala.io reads a file into a String (via mkString) vs. file2String :-) </p>
<p>Lau hasn&#8217;t been so restricted, </p>
<p>&#8220;(note: spit and slurp* are from contrib.duck-streams and str-join are from str-utils)&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zach Cox</title>
		<link>http://codemonkeyism.com/scala-vs-clojure-flawed-loc-comparison/comment-page-1/#comment-262298</link>
		<dc:creator>Zach Cox</dc:creator>
		<pubDate>Mon, 04 Jan 2010 17:00:20 +0000</pubDate>
		<guid isPermaLink="false">http://codemonkeyism.com/?p=1408#comment-262298</guid>
		<description>I agree that Scala and Clojure are both great Java-replacements and that they appeal to different developers.  Regarding the missing library calls in my Scala version, I wanted to use only core libraries, nothing 3rd party.  I just commented on my original post (that spawned Lau&#039;s Clojure vs Ruby/Scala post) that gives some more background as well as revised Ruby and Scala versions:

http://blogs.sourceallies.com/2009/12/word-counts-example-in-ruby-and-scala/comment-page-1/#comment-280

Further improvements are always welcome! :)</description>
		<content:encoded><![CDATA[<p>I agree that Scala and Clojure are both great Java-replacements and that they appeal to different developers.  Regarding the missing library calls in my Scala version, I wanted to use only core libraries, nothing 3rd party.  I just commented on my original post (that spawned Lau&#8217;s Clojure vs Ruby/Scala post) that gives some more background as well as revised Ruby and Scala versions:</p>
<p><a href="http://blogs.sourceallies.com/2009/12/word-counts-example-in-ruby-and-scala/comment-page-1/#comment-280" rel="nofollow">http://blogs.sourceallies.com/2009/12/word-counts-example-in-ruby-and-scala/comment-page-1/#comment-280</a></p>
<p>Further improvements are always welcome! :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stephan</title>
		<link>http://codemonkeyism.com/scala-vs-clojure-flawed-loc-comparison/comment-page-1/#comment-262293</link>
		<dc:creator>stephan</dc:creator>
		<pubDate>Mon, 04 Jan 2010 16:12:32 +0000</pubDate>
		<guid isPermaLink="false">http://codemonkeyism.com/?p=1408#comment-262293</guid>
		<description>@Jarkko: Might be it isn&#039;t intentional, but then why compare? Why does a Clojure enthusiast compare some code to Scala in a deeply flawed why? Something which will stay in Google for a long time? Is there something like unintentional FUD? ;-)</description>
		<content:encoded><![CDATA[<p>@Jarkko: Might be it isn&#8217;t intentional, but then why compare? Why does a Clojure enthusiast compare some code to Scala in a deeply flawed why? Something which will stay in Google for a long time? Is there something like unintentional FUD? ;-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jarkko Oranen</title>
		<link>http://codemonkeyism.com/scala-vs-clojure-flawed-loc-comparison/comment-page-1/#comment-262281</link>
		<dc:creator>Jarkko Oranen</dc:creator>
		<pubDate>Mon, 04 Jan 2010 15:17:25 +0000</pubDate>
		<guid isPermaLink="false">http://codemonkeyism.com/?p=1408#comment-262281</guid>
		<description>In Lau&#039;s defense, I think calling his article FUD is a bit unfair. It might be biased, but I don&#039;t think that&#039;s &quot;strategic&quot; or intentional. These kinds of comparisons are easy to carry out, but it&#039;s also easy to forget to be impartial and ensure that you&#039;re actually comparing apples to apples.

The unfortunate side-effect (hah!) of &quot;vs&quot; articles is that they don&#039;t reflect well on the Clojure community, as someone is bound to take them the wrong way. 

As a Clojure person myself, I believe Clojure can stand on its own, and I hope it will, without any need to downplay the merits of other languages. I&#039;m sure most of the community would agree with me.</description>
		<content:encoded><![CDATA[<p>In Lau&#8217;s defense, I think calling his article FUD is a bit unfair. It might be biased, but I don&#8217;t think that&#8217;s &#8220;strategic&#8221; or intentional. These kinds of comparisons are easy to carry out, but it&#8217;s also easy to forget to be impartial and ensure that you&#8217;re actually comparing apples to apples.</p>
<p>The unfortunate side-effect (hah!) of &#8220;vs&#8221; articles is that they don&#8217;t reflect well on the Clojure community, as someone is bound to take them the wrong way. </p>
<p>As a Clojure person myself, I believe Clojure can stand on its own, and I hope it will, without any need to downplay the merits of other languages. I&#8217;m sure most of the community would agree with me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fogus</title>
		<link>http://codemonkeyism.com/scala-vs-clojure-flawed-loc-comparison/comment-page-1/#comment-262275</link>
		<dc:creator>fogus</dc:creator>
		<pubDate>Mon, 04 Jan 2010 14:45:04 +0000</pubDate>
		<guid isPermaLink="false">http://codemonkeyism.com/?p=1408#comment-262275</guid>
		<description>The problem wasn&#039;t that the OP was FUd... it was that it wasn&#039;t FUD *enough*!  See my more frightening Scala version for the right way to make my favorite language look better.

http://blog.fogus.me/2010/01/04/comparing-lines-of-code-scala-and-clojure-fud-version/

-m</description>
		<content:encoded><![CDATA[<p>The problem wasn&#8217;t that the OP was FUd&#8230; it was that it wasn&#8217;t FUD *enough*!  See my more frightening Scala version for the right way to make my favorite language look better.</p>
<p><a href="http://blog.fogus.me/2010/01/04/comparing-lines-of-code-scala-and-clojure-fud-version/" rel="nofollow">http://blog.fogus.me/2010/01/04/comparing-lines-of-code-scala-and-clojure-fud-version/</a></p>
<p>-m</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: -= Comparing Lines of Code: Scala and Clojure (FUD version) =-</title>
		<link>http://codemonkeyism.com/scala-vs-clojure-flawed-loc-comparison/comment-page-1/#comment-262273</link>
		<dc:creator>-= Comparing Lines of Code: Scala and Clojure (FUD version) =-</dc:creator>
		<pubDate>Mon, 04 Jan 2010 14:41:19 +0000</pubDate>
		<guid isPermaLink="false">http://codemonkeyism.com/?p=1408#comment-262273</guid>
		<description>[...] &#8212; the Scala version was intentionally obfuscated for chuckles. For a much more eloquent rebutal of flawed LOC comparisions read Stephan Schmidt&#8217;s latest post on the subject.&#160;&#8617;       No Comments, Comment or [...]</description>
		<content:encoded><![CDATA[<p>[...] &#8212; the Scala version was intentionally obfuscated for chuckles. For a much more eloquent rebutal of flawed LOC comparisions read Stephan Schmidt&#8217;s latest post on the subject.&#160;&#8617;       No Comments, Comment or [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (user agent is rejected)
Database Caching using disk
Object Caching 438/439 objects using disk

Served from: codemonkeyism.com @ 2012-05-22 21:36:34 -->
