<?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: Ruby For Java (and C#) Programmers, Part 3 - Introducing Arrays, Hashes and the typing&#160;system</title>
	<atom:link href="http://www.magpiebrain.com/blog/2005/06/16/ruby-for-java-and-c-programmers-part-3-introducing-arrays-hashes-and-the-typing-system/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.magpiebrain.com/blog/2005/06/16/ruby-for-java-and-c-programmers-part-3-introducing-arrays-hashes-and-the-typing-system/</link>
	<description>Sam Newman's blog</description>
	<pubDate>Sat, 05 Jul 2008 00:48:27 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Jules</title>
		<link>http://www.magpiebrain.com/blog/2005/06/16/ruby-for-java-and-c-programmers-part-3-introducing-arrays-hashes-and-the-typing-system/#comment-775</link>
		<dc:creator>Jules</dc:creator>
		<pubDate>Wed, 18 Jan 2006 16:26:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.magpiebrain.com/2005/06/16/ruby-for-java-and-c-programmers-part-3-introducing-arrays-hashes-and-the-typing-system/#comment-775</guid>
		<description>Nice article, except:

@array.each { &#124; item &#124; puts item.to_s }@

Because:

@array.each { &#124; item &#124; puts item }@

and:

@puts array@

Would do *exactly* the same thing. Maybe:

@array.each{&#124;item&#124; puts item.length}@

But that could be:

@puts array.map{&#124;item&#124; item.length}@

In Ruby world, you'd write something as simple as possible, and that means as concise as possible most times.

And it's often a good idea to separate the IO from the "real" code.

Really good article though. I'd like to read more about Enumerable methods, because this slightly functional module is hard to understand for Java/C# programmers. (C# is going functional too, with anonymous functions)

Keep up the good work!
</description>
		<content:encoded><![CDATA[<p>Nice article, except:</p>
<p><code>array.each { | item | puts item.to_s }</code></p>
<p>Because:</p>
<p><code>array.each { | item | puts item }</code></p>
<p>and:</p>
<p><code>puts array</code></p>
<p>Would do <strong>exactly</strong> the same thing. Maybe:</p>
<p><code>array.each{|item| puts item.length}</code></p>
<p>But that could be:</p>
<p><code>puts array.map{|item| item.length}</code></p>
<p>In Ruby world, you&#8217;d write something as simple as possible, and that means as concise as possible most times.</p>
<p>And it&#8217;s often a good idea to separate the IO from the &#8220;real&#8221; code.</p>
<p>Really good article though. I&#8217;d like to read more about Enumerable methods, because this slightly functional module is hard to understand for Java/C# programmers. (C# is going functional too, with anonymous functions)</p>
<p>Keep up the good work!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sam newman</title>
		<link>http://www.magpiebrain.com/blog/2005/06/16/ruby-for-java-and-c-programmers-part-3-introducing-arrays-hashes-and-the-typing-system/#comment-774</link>
		<dc:creator>sam newman</dc:creator>
		<pubDate>Mon, 20 Jun 2005 22:41:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.magpiebrain.com/2005/06/16/ruby-for-java-and-c-programmers-part-3-introducing-arrays-hashes-and-the-typing-system/#comment-774</guid>
		<description>Godamit! Corrections being made now....grr...</description>
		<content:encoded><![CDATA[<p>Godamit! Corrections being made now&#8230;.grr&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Rimmer</title>
		<link>http://www.magpiebrain.com/blog/2005/06/16/ruby-for-java-and-c-programmers-part-3-introducing-arrays-hashes-and-the-typing-system/#comment-773</link>
		<dc:creator>Chris Rimmer</dc:creator>
		<pubDate>Mon, 20 Jun 2005 21:41:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.magpiebrain.com/2005/06/16/ruby-for-java-and-c-programmers-part-3-introducing-arrays-hashes-and-the-typing-system/#comment-773</guid>
		<description>Call me Mr Picky if you want (it's an improvement on "Chirs" at least), but I also think you mean "Naturalist".</description>
		<content:encoded><![CDATA[<p>Call me Mr Picky if you want (it&#8217;s an improvement on &#8220;Chirs&#8221; at least), but I also think you mean &#8220;Naturalist&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sam newman</title>
		<link>http://www.magpiebrain.com/blog/2005/06/16/ruby-for-java-and-c-programmers-part-3-introducing-arrays-hashes-and-the-typing-system/#comment-772</link>
		<dc:creator>sam newman</dc:creator>
		<pubDate>Mon, 20 Jun 2005 20:40:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.magpiebrain.com/2005/06/16/ruby-for-java-and-c-programmers-part-3-introducing-arrays-hashes-and-the-typing-system/#comment-772</guid>
		<description>Yes Chirs, it certainly should :-) In an alternative universe, I'm sure there is a me who actually proof reads this stuff and runs the code snippets through irb...</description>
		<content:encoded><![CDATA[<p>Yes Chirs, it certainly should :-) In an alternative universe, I&#8217;m sure there is a me who actually proof reads this stuff and runs the code snippets through irb&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Rimmer</title>
		<link>http://www.magpiebrain.com/blog/2005/06/16/ruby-for-java-and-c-programmers-part-3-introducing-arrays-hashes-and-the-typing-system/#comment-771</link>
		<dc:creator>Chris Rimmer</dc:creator>
		<pubDate>Mon, 20 Jun 2005 20:17:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.magpiebrain.com/2005/06/16/ruby-for-java-and-c-programmers-part-3-introducing-arrays-hashes-and-the-typing-system/#comment-771</guid>
		<description>Um, shouldn't this:

array.find_all { &#124; item &#124; item =&#62; 8 }  --&#62; [8, 10]

be this?

array.find_all { &#124; item &#124; item &#62;= 8 }  --&#62; [8, 10]</description>
		<content:encoded><![CDATA[<p>Um, shouldn&#8217;t this:</p>
<p>array.find_all { | item | item => 8 } &#8212;> [8, 10]</p>
<p>be this?</p>
<p>array.find_all { | item | item >= 8 } &#8212;> [8, 10]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam Newman</title>
		<link>http://www.magpiebrain.com/blog/2005/06/16/ruby-for-java-and-c-programmers-part-3-introducing-arrays-hashes-and-the-typing-system/#comment-770</link>
		<dc:creator>Sam Newman</dc:creator>
		<pubDate>Mon, 20 Jun 2005 09:13:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.magpiebrain.com/2005/06/16/ruby-for-java-and-c-programmers-part-3-introducing-arrays-hashes-and-the-typing-system/#comment-770</guid>
		<description>I'm not sure how they do solve the above example (and there are differences between Java generics and C++ templates) - the initial problem here is that @Dog@ and @Dog@ are in seperate hierarchies. The two Java solutions are either to implement a more fine-grained interface (e.g. @Communicative@) which defines the @speak@ method, or to define a new base interface as I showed above. With Ruby there is no need for either. Don't forget as well that Ruby's type system is also dynamic - the lack of a dynamic typing system is the reason why you end up having to mess around with code generation, bytecode weaving and dynamic proxies for things like AOP, JDO and Hibernate in Java.</description>
		<content:encoded><![CDATA[<p>I&#8217;m not sure how they do solve the above example (and there are differences between Java generics and C++ templates) &#8211; the initial problem here is that <code>Dog</code> and <code>Dog</code> are in seperate hierarchies. The two Java solutions are either to implement a more fine-grained interface (e.g. <code>Communicative</code>) which defines the <code>speak</code> method, or to define a new base interface as I showed above. With Ruby there is no need for either. Don&#8217;t forget as well that Ruby&#8217;s type system is also dynamic &#8211; the lack of a dynamic typing system is the reason why you end up having to mess around with code generation, bytecode weaving and dynamic proxies for things like AOP, JDO and Hibernate in Java.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh Graham</title>
		<link>http://www.magpiebrain.com/blog/2005/06/16/ruby-for-java-and-c-programmers-part-3-introducing-arrays-hashes-and-the-typing-system/#comment-769</link>
		<dc:creator>Josh Graham</dc:creator>
		<pubDate>Mon, 20 Jun 2005 08:13:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.magpiebrain.com/2005/06/16/ruby-for-java-and-c-programmers-part-3-introducing-arrays-hashes-and-the-typing-system/#comment-769</guid>
		<description>How do Java's new "Generics" (like C++ Templates) solve (or not) your comparison on the Duck / Dog speak method call. I'm reckoning they do.</description>
		<content:encoded><![CDATA[<p>How do Java&#8217;s new &#8220;Generics&#8221; (like C++ Templates) solve (or not) your comparison on the Duck / Dog speak method call. I&#8217;m reckoning they do.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sam newman</title>
		<link>http://www.magpiebrain.com/blog/2005/06/16/ruby-for-java-and-c-programmers-part-3-introducing-arrays-hashes-and-the-typing-system/#comment-768</link>
		<dc:creator>sam newman</dc:creator>
		<pubDate>Sat, 18 Jun 2005 21:21:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.magpiebrain.com/2005/06/16/ruby-for-java-and-c-programmers-part-3-introducing-arrays-hashes-and-the-typing-system/#comment-768</guid>
		<description>That's certainly coming up Gary - although next I think I'm either going to look at string and IO handling, or I'll be looking at map/reduce.</description>
		<content:encoded><![CDATA[<p>That&#8217;s certainly coming up Gary &#8211; although next I think I&#8217;m either going to look at string and IO handling, or I&#8217;ll be looking at map/reduce.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gary Blomquist</title>
		<link>http://www.magpiebrain.com/blog/2005/06/16/ruby-for-java-and-c-programmers-part-3-introducing-arrays-hashes-and-the-typing-system/#comment-767</link>
		<dc:creator>Gary Blomquist</dc:creator>
		<pubDate>Fri, 17 Jun 2005 20:36:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.magpiebrain.com/2005/06/16/ruby-for-java-and-c-programmers-part-3-introducing-arrays-hashes-and-the-typing-system/#comment-767</guid>
		<description>If you're taking votes, I vote for "the dynamic nature of Ruby's typing" for the next article.</description>
		<content:encoded><![CDATA[<p>If you&#8217;re taking votes, I vote for &#8220;the dynamic nature of Ruby&#8217;s typing&#8221; for the next article.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam Newman</title>
		<link>http://www.magpiebrain.com/blog/2005/06/16/ruby-for-java-and-c-programmers-part-3-introducing-arrays-hashes-and-the-typing-system/#comment-766</link>
		<dc:creator>Sam Newman</dc:creator>
		<pubDate>Fri, 17 Jun 2005 09:06:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.magpiebrain.com/2005/06/16/ruby-for-java-and-c-programmers-part-3-introducing-arrays-hashes-and-the-typing-system/#comment-766</guid>
		<description>Aslak - I do plan to look at API comparisons (especially IO and XML handling) although this might be in part 5. In the next part I'm either going to look at the dynamic nature of Ruby's typing, or look at more advanced use of Hashes/Arrays and some string handling.

Oh, and thanks for stopping the typo Anjan - I really shouls stop writing this stuff late at night...</description>
		<content:encoded><![CDATA[<p>Aslak &#8211; I do plan to look at <acronym title="Application Programming Interface">API</acronym> comparisons (especially IO and <acronym title="eXtensible Markup Language">XML</acronym> handling) although this might be in part 5. In the next part I&#8217;m either going to look at the dynamic nature of Ruby&#8217;s typing, or look at more advanced use of Hashes/Arrays and some string handling.</p>
<p>Oh, and thanks for stopping the typo Anjan &#8211; I really shouls stop writing this stuff late at night&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
