<?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: Diving into Scala</title>
	<atom:link href="http://www.codecommit.com/blog/scala/diving-into-scala/feed" rel="self" type="application/rss+xml" />
	<link>http://www.codecommit.com/blog/scala/diving-into-scala</link>
	<description>(permanently in beta)</description>
	<lastBuildDate>Sun, 29 Aug 2010 20:01:44 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Daniel Spiewak</title>
		<link>http://www.codecommit.com/blog/scala/diving-into-scala/comment-page-1#comment-4997</link>
		<dc:creator>Daniel Spiewak</dc:creator>
		<pubDate>Sat, 22 May 2010 21:48:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/scala/diving-into-scala#comment-4997</guid>
		<description>&gt; I suppose I could duplicate the arguments in the object and create a delegation to the “new” constructor…

That&#039;s basically what you have to do.  :-)  In fact, that&#039;s almost exactly the same thing that case class is doing for you.  What you&#039;re going to end up with is something like this:

&lt;pre&gt;class Foo(a: Int, b: String) {
  ...
}

object Foo {
  def apply(a: Int, b: String) = new Foo(a, b)
}&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>&gt; I suppose I could duplicate the arguments in the object and create a delegation to the “new” constructor…</p>
<p>That&#8217;s basically what you have to do.  <img src='http://www.codecommit.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />   In fact, that&#8217;s almost exactly the same thing that case class is doing for you.  What you&#8217;re going to end up with is something like this:</p>
<pre>class Foo(a: Int, b: String) {
  ...
}

object Foo {
  def apply(a: Int, b: String) = new Foo(a, b)
}</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Fischer</title>
		<link>http://www.codecommit.com/blog/scala/diving-into-scala/comment-page-1#comment-4995</link>
		<dc:creator>Robert Fischer</dc:creator>
		<pubDate>Thu, 20 May 2010 20:30:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/scala/diving-into-scala#comment-4995</guid>
		<description>Is there a way to fake out the syntax for something other than case classes?  Non-case classes require the &quot;new&quot; operator.  I suppose I could duplicate the arguments in the object and create a delegation to the &quot;new&quot; constructor...</description>
		<content:encoded><![CDATA[<p>Is there a way to fake out the syntax for something other than case classes?  Non-case classes require the &#8220;new&#8221; operator.  I suppose I could duplicate the arguments in the object and create a delegation to the &#8220;new&#8221; constructor&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nos Doughty</title>
		<link>http://www.codecommit.com/blog/scala/diving-into-scala/comment-page-1#comment-3533</link>
		<dc:creator>Nos Doughty</dc:creator>
		<pubDate>Wed, 30 Apr 2008 08:57:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/scala/diving-into-scala#comment-3533</guid>
		<description>It&#039;s absolutely correct to say that the docs for Scala are designed for someone coming from a functional programming background. When I first looked at Scala I realized that I couldn&#039;t get my head around the functional paradigm and so contented myself with Ruby and Groovy (Groovy has very different advantages and disadvantages from Scala, such as metaprogramming, and shouldn&#039;t be thought of as an replacement; rather they both stand on their own).

I then did some research on Lisp/Scheme Haskel, Erlang and OCAML. A few days ago I bought the pre-realease of the new Scala book and am blazing though it. The weirdnesses mentioned in the Article above make *perfect* sense from a functional language and I am *loving* the language. As for things like the p._1 - as the book explains they are for tuples which is a *core-concept* of functional languages and the syntax makes sense once you understand what they are (&#039;parameter 1, parameter 2) with the reason they are not array syntax being because of varying return types. I suspect the syntax is far less confusing then the &#039;Anonymous Classes&#039; would be for those who have never seen that either.

No-one can say for certain that Scala will never replace Java on the JVM . There are two things to remember. 

1) As Scala compiles to byecode then *parts* of projects can be replaced by Scala. For example, in a complex financial application, perhaps the calculation routines could be done in Scala by the senior developers and just used as a normal library by the other developers.

2) Which languages are used in the future will depend on developments in concurrency. If we start using 80 core Intel chips int he future then threading is going to &#039;separate the men from the boys&#039; as I&#039;ve heard it described :) Sclala&#039;s functional subset and it&#039;s Actor model is going to make it start looking pretty good compared to Java.

btw, has everyone forgotten how weird Java&#039;s constructor syntax looked compared to C++&#039;s which we were using before Java came out?

Cheers</description>
		<content:encoded><![CDATA[<p>It&#8217;s absolutely correct to say that the docs for Scala are designed for someone coming from a functional programming background. When I first looked at Scala I realized that I couldn&#8217;t get my head around the functional paradigm and so contented myself with Ruby and Groovy (Groovy has very different advantages and disadvantages from Scala, such as metaprogramming, and shouldn&#8217;t be thought of as an replacement; rather they both stand on their own).</p>
<p>I then did some research on Lisp/Scheme Haskel, Erlang and OCAML. A few days ago I bought the pre-realease of the new Scala book and am blazing though it. The weirdnesses mentioned in the Article above make *perfect* sense from a functional language and I am *loving* the language. As for things like the p._1 &#8211; as the book explains they are for tuples which is a *core-concept* of functional languages and the syntax makes sense once you understand what they are (&#8216;parameter 1, parameter 2) with the reason they are not array syntax being because of varying return types. I suspect the syntax is far less confusing then the &#8216;Anonymous Classes&#8217; would be for those who have never seen that either.</p>
<p>No-one can say for certain that Scala will never replace Java on the JVM . There are two things to remember. </p>
<p>1) As Scala compiles to byecode then *parts* of projects can be replaced by Scala. For example, in a complex financial application, perhaps the calculation routines could be done in Scala by the senior developers and just used as a normal library by the other developers.</p>
<p>2) Which languages are used in the future will depend on developments in concurrency. If we start using 80 core Intel chips int he future then threading is going to &#8217;separate the men from the boys&#8217; as I&#8217;ve heard it described <img src='http://www.codecommit.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Sclala&#8217;s functional subset and it&#8217;s Actor model is going to make it start looking pretty good compared to Java.</p>
<p>btw, has everyone forgotten how weird Java&#8217;s constructor syntax looked compared to C++&#8217;s which we were using before Java came out?</p>
<p>Cheers</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Per Olesen</title>
		<link>http://www.codecommit.com/blog/scala/diving-into-scala/comment-page-1#comment-2622</link>
		<dc:creator>Per Olesen</dc:creator>
		<pubDate>Thu, 03 Jan 2008 12:05:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/scala/diving-into-scala#comment-2622</guid>
		<description>I really enjoyed reading this post about scala. Mostly because I have been thinking about looking at scala myself, but have not really found the time (or real interest) in it yet. Until I got to your conclusion, my own conclusion was, that his language (also) will not be the one that beats the Java platform.

When you write &quot;..Scala’s at an interesting place right now....&quot;, I think: But will it change to the better? Isn&#039;t it kind of rare, that a language changes in areas like the ones you mention (constructors, static constructs, () &quot;overloading&quot;,...) when it has already been published? Changing such stuff radically would break a lot stuff around already, not to mention piss of the current followers, who like the constructs?

As the language stands right now, it seems to me, that it is a bit too different, from what the masses will jump onto. A big part of this is all the functional stuff. When clever people say, that the next big language will be functional, I tend to disagree. Maybe they are right, when you think about what we need to be able to write faster programs for the many cores of the future. But I think they are missing the migration path from the current big language (Java) to the upcoming one. I can&#039;t really figure out if it is just me, that is getting old :-)</description>
		<content:encoded><![CDATA[<p>I really enjoyed reading this post about scala. Mostly because I have been thinking about looking at scala myself, but have not really found the time (or real interest) in it yet. Until I got to your conclusion, my own conclusion was, that his language (also) will not be the one that beats the Java platform.</p>
<p>When you write &#8220;..Scala’s at an interesting place right now&#8230;.&#8221;, I think: But will it change to the better? Isn&#8217;t it kind of rare, that a language changes in areas like the ones you mention (constructors, static constructs, () &#8220;overloading&#8221;,&#8230;) when it has already been published? Changing such stuff radically would break a lot stuff around already, not to mention piss of the current followers, who like the constructs?</p>
<p>As the language stands right now, it seems to me, that it is a bit too different, from what the masses will jump onto. A big part of this is all the functional stuff. When clever people say, that the next big language will be functional, I tend to disagree. Maybe they are right, when you think about what we need to be able to write faster programs for the many cores of the future. But I think they are missing the migration path from the current big language (Java) to the upcoming one. I can&#8217;t really figure out if it is just me, that is getting old <img src='http://www.codecommit.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Spiewak</title>
		<link>http://www.codecommit.com/blog/scala/diving-into-scala/comment-page-1#comment-2621</link>
		<dc:creator>Daniel Spiewak</dc:creator>
		<pubDate>Thu, 03 Jan 2008 02:52:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/scala/diving-into-scala#comment-2621</guid>
		<description>Yeah, I think it&#039;s safe to say that the examples on the scala-lang page were designed for people coming from the functional paradigm.  What Scala needs is a good introductory page for Java/imperative developers.  After all, that&#039;s where most of the meat is that&#039;s interested in the language.</description>
		<content:encoded><![CDATA[<p>Yeah, I think it&#8217;s safe to say that the examples on the scala-lang page were designed for people coming from the functional paradigm.  What Scala needs is a good introductory page for Java/imperative developers.  After all, that&#8217;s where most of the meat is that&#8217;s interested in the language.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hohonuuli</title>
		<link>http://www.codecommit.com/blog/scala/diving-into-scala/comment-page-1#comment-2620</link>
		<dc:creator>hohonuuli</dc:creator>
		<pubDate>Thu, 03 Jan 2008 02:44:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/scala/diving-into-scala#comment-2620</guid>
		<description>@Daniel
Oh, I completely agree that Groovy has &quot;odd angles and corners&quot;; but it sure is fun to program with and I can get lots of work done with it. Scala on the other hand, well, here&#039;s a few examples of why Scala &quot;drives me crazy&quot;:

(1 until 1000).filter(n =&gt; n % 3 == 0 &#124;&#124; n % 5 == 0).foldLeft(0)(_ + _) 

lazy val fib: Stream[Int] = Stream.cons(0,   Stream.cons(1, fib.zip(fib.tail).map(p =&gt; p._1 + p._2))) 

These examples are from http://scala-blogs.org/2007/12/project-euler-fun-in-scala.html. They illustrate that it&#039;s not enough to know what arguments a method or function takes. You have to know the &quot;special details&quot;, like what the underscores do in foldLeft and what to do p._1 and p._2 mean.  Take a look at the docs for p._1 at http://www.scala-lang.org/docu/files/api/scala/Product2.html#_1. (They weren&#039;t too helpful for me) BTW, if you picked Scala right up then I bow down before you. ;-)</description>
		<content:encoded><![CDATA[<p>@Daniel<br />
Oh, I completely agree that Groovy has &#8220;odd angles and corners&#8221;; but it sure is fun to program with and I can get lots of work done with it. Scala on the other hand, well, here&#8217;s a few examples of why Scala &#8220;drives me crazy&#8221;:</p>
<p>(1 until 1000).filter(n =&gt; n % 3 == 0 || n % 5 == 0).foldLeft(0)(_ + _) </p>
<p>lazy val fib: Stream[Int] = Stream.cons(0,   Stream.cons(1, fib.zip(fib.tail).map(p =&gt; p._1 + p._2))) </p>
<p>These examples are from <a href="http://scala-blogs.org/2007/12/project-euler-fun-in-scala.html" rel="nofollow">http://scala-blogs.org/2007/12/project-euler-fun-in-scala.html</a>. They illustrate that it&#8217;s not enough to know what arguments a method or function takes. You have to know the &#8220;special details&#8221;, like what the underscores do in foldLeft and what to do p._1 and p._2 mean.  Take a look at the docs for p._1 at <a href="http://www.scala-lang.org/docu/files/api/scala/Product2.html#_1" rel="nofollow">http://www.scala-lang.org/docu/files/api/scala/Product2.html#_1</a>. (They weren&#8217;t too helpful for me) BTW, if you picked Scala right up then I bow down before you. <img src='http://www.codecommit.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Spiewak</title>
		<link>http://www.codecommit.com/blog/scala/diving-into-scala/comment-page-1#comment-2619</link>
		<dc:creator>Daniel Spiewak</dc:creator>
		<pubDate>Wed, 02 Jan 2008 22:42:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/scala/diving-into-scala#comment-2619</guid>
		<description>@hohonuuli
Actually, I&#039;ve run into fewer gotchas learning Scala than I did when I tried to pickup Groovy.  Groovy basically started with Java&#039;s syntax and scriptified it, which leads to tons of odd angles and corners.  The result is face-polished and quite nice, but when you really dig into it things start to get hairy.  Because Scala wasn&#039;t trying to be another language at the same time, I think it&#039;s a bit easier to learn.

Dead on with the docs comment though.  I was able to get on by myself more or less using an interactive Scala shell, the core scaladocs and the Scala wiki, but there were a few places that I just couldn&#039;t fight my way through the woods.  That&#039;s when you contact your local scala expert (in my case Alex Blewitt) and beg advice.  :-)  It&#039;s something the Scala language community really needs to work on though.  Too much of the &quot;documentation&quot; is just left up to the imagination and ingenuity of the developer.</description>
		<content:encoded><![CDATA[<p>@hohonuuli<br />
Actually, I&#8217;ve run into fewer gotchas learning Scala than I did when I tried to pickup Groovy.  Groovy basically started with Java&#8217;s syntax and scriptified it, which leads to tons of odd angles and corners.  The result is face-polished and quite nice, but when you really dig into it things start to get hairy.  Because Scala wasn&#8217;t trying to be another language at the same time, I think it&#8217;s a bit easier to learn.</p>
<p>Dead on with the docs comment though.  I was able to get on by myself more or less using an interactive Scala shell, the core scaladocs and the Scala wiki, but there were a few places that I just couldn&#8217;t fight my way through the woods.  That&#8217;s when you contact your local scala expert (in my case Alex Blewitt) and beg advice.  <img src='http://www.codecommit.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />   It&#8217;s something the Scala language community really needs to work on though.  Too much of the &#8220;documentation&#8221; is just left up to the imagination and ingenuity of the developer.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hohonuuli</title>
		<link>http://www.codecommit.com/blog/scala/diving-into-scala/comment-page-1#comment-2618</link>
		<dc:creator>hohonuuli</dc:creator>
		<pubDate>Wed, 02 Jan 2008 22:30:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/scala/diving-into-scala#comment-2618</guid>
		<description>Nice post! I&#039;m trying to like Scala, but I&#039;ve run into exactly the same kind of &#039;things that make me go hmmmm.&quot; It&#039;s good to hear that I&#039;m not the only one. Until the Scala docs improve, I&#039;ll be sticking with Java + Groovy.</description>
		<content:encoded><![CDATA[<p>Nice post! I&#8217;m trying to like Scala, but I&#8217;ve run into exactly the same kind of &#8216;things that make me go hmmmm.&#8221; It&#8217;s good to hear that I&#8217;m not the only one. Until the Scala docs improve, I&#8217;ll be sticking with Java + Groovy.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Franey</title>
		<link>http://www.codecommit.com/blog/scala/diving-into-scala/comment-page-1#comment-2617</link>
		<dc:creator>John Franey</dc:creator>
		<pubDate>Wed, 02 Jan 2008 21:03:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/scala/diving-into-scala#comment-2617</guid>
		<description>I agree [ but I don&#039;t take the quoted ruby code as an operator overload.   Its seems to me to be a clear-cut method override.]

I think your point is that when developers see &quot;a + b&quot; they presume it means what it means in mathematics and they cannot be shaken from that presumption.  They presume that this operator has all the qualities of the &#039;+&#039; operator with numeric operands, i.e. associative, communicative, transitive and symmetric qualities in addition to the summation behaviour.   Not all implementations of operator + shared these qualities and so developers made incorrect assumptions.  Reuse of the + name for an operation therefore is more dangerous somehow than reuse of the name &#039;plus&#039; instead.

Elliot Rusty Harold thinks about the same: http://cafe.elharo.com/java/operator-overloading-considered-harmful/

Checkout Bruce Eckel&#039;s rebuttal on that page.  He starts with: &quot;Unfortunately, Gosling did not seem to understand the actual problems with operator overloading in C++, and so he condemned it out of hand. People have been echoing this condemnation ever since.&quot;   Bruce says the real problem of operator overloading was complexity of implementation due to memory management concerns.

So, since scala is not C++, and does not have these memory issues, maybe scala developers have an opportunity that Java developers don&#039;t have:  to see the good side of operator overloading when its appropriate.

By the way, scala helps the developer with respect to precedence.  If a method name starts with a &#039;*&#039; then it has the precedence of a &#039;muliplication&#039;.  If a method name starts with &#039;+&#039;, it has the precedence of an &#039;addition&#039;, and so on.  So problems with precedence won&#039;t be so easy to implement in scala.


Personally, I like operator overloading.

Regards,
John</description>
		<content:encoded><![CDATA[<p>I agree [ but I don't take the quoted ruby code as an operator overload.   Its seems to me to be a clear-cut method override.]</p>
<p>I think your point is that when developers see &#8220;a + b&#8221; they presume it means what it means in mathematics and they cannot be shaken from that presumption.  They presume that this operator has all the qualities of the &#8216;+&#8217; operator with numeric operands, i.e. associative, communicative, transitive and symmetric qualities in addition to the summation behaviour.   Not all implementations of operator + shared these qualities and so developers made incorrect assumptions.  Reuse of the + name for an operation therefore is more dangerous somehow than reuse of the name &#8216;plus&#8217; instead.</p>
<p>Elliot Rusty Harold thinks about the same: <a href="http://cafe.elharo.com/java/operator-overloading-considered-harmful/" rel="nofollow">http://cafe.elharo.com/java/operator-overloading-considered-harmful/</a></p>
<p>Checkout Bruce Eckel&#8217;s rebuttal on that page.  He starts with: &#8220;Unfortunately, Gosling did not seem to understand the actual problems with operator overloading in C++, and so he condemned it out of hand. People have been echoing this condemnation ever since.&#8221;   Bruce says the real problem of operator overloading was complexity of implementation due to memory management concerns.</p>
<p>So, since scala is not C++, and does not have these memory issues, maybe scala developers have an opportunity that Java developers don&#8217;t have:  to see the good side of operator overloading when its appropriate.</p>
<p>By the way, scala helps the developer with respect to precedence.  If a method name starts with a &#8216;*&#8217; then it has the precedence of a &#8216;muliplication&#8217;.  If a method name starts with &#8216;+&#8217;, it has the precedence of an &#8216;addition&#8217;, and so on.  So problems with precedence won&#8217;t be so easy to implement in scala.</p>
<p>Personally, I like operator overloading.</p>
<p>Regards,<br />
John</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lopex</title>
		<link>http://www.codecommit.com/blog/scala/diving-into-scala/comment-page-1#comment-2616</link>
		<dc:creator>lopex</dc:creator>
		<pubDate>Wed, 02 Jan 2008 20:19:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/scala/diving-into-scala#comment-2616</guid>
		<description>The parentheses can be left out so there is a convention to stress that a method doesn&#039;t have side effects (and is as well a historical remnant), more detailed discussion:
http://www.nabble.com/-scala--%28Side-Effects%29-and-Parens-td13438418.html#a13438418</description>
		<content:encoded><![CDATA[<p>The parentheses can be left out so there is a convention to stress that a method doesn&#8217;t have side effects (and is as well a historical remnant), more detailed discussion:<br />
<a href="http://www.nabble.com/-scala--%28Side-Effects%29-and-Parens-td13438418.html#a13438418" rel="nofollow">http://www.nabble.com/-scala&#8211;%28Side-Effects%29-and-Parens-td13438418.html#a13438418</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
