<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>Crisis Averted!: Passed the Rubicon</title>
    <link>http://socket7.net</link>
    <description>Crisis Averted!  A weblog by Brett Stimmerman.</description>
    <managingEditor>brettstimmerman@gmail.com (Brett Stimmerman)</managingEditor>
    <webMaster>brettstimmerman@gmail.com (Brett Stimmerman)</webMaster>
    <docs>http://backend.userland.com/rss</docs>
    <ttl>60</ttl>

  <item>
  <title>Re: Pure object language</title>
  <link>http://socket7.net/article/passed-the-rubicon#comment-12</link>
  <author>Sebastian (http://groket.com/)</author>
  <description>
    &lt;p&gt;&quot;Things should be as simple as possible, but not any simpler.&quot; -A.E.&lt;/p&gt;

&lt;p&gt;I very much agree that Ruby produces very readable code, but the overhead just seems a bit much.  In truth, considering how rarely this type of construct will actually be used, it may just be a convenience thing.  When was the last time you looped something over an exact value and not the size of another data structure?&lt;/p&gt;

&lt;pre&gt;
my $i= scalar( @arr );
while( $i-- ){ 
    # do something 
}
&lt;/pre&gt;

&lt;p&gt;Perl has it's own flavor of this, but instead of making literal values into objects it requires a special operator (like everything in perl):&lt;/p&gt;

&lt;pre&gt;
while( 1..10 ){
    print $_;
}
&lt;/pre&gt;

&lt;p&gt;While Java can't compete with the Perl/Ruby whippupatude, it does offer a very readable method.&lt;/p&gt;

&lt;pre&gt;
// yea, that's too much work to post
&lt;/pre&gt;

&lt;p&gt;It seems like Ruby has taken object oriented just a little too far by making &lt;em&gt;everything&lt;/em&gt; into an object.  Maybe it's to promote good coding practices and creating readable code, but it still just feels wrong.&lt;/p&gt;
  </description>
  <guid isPermaLink="true">http://socket7.net/article/passed-the-rubicon#comment-12</guid>
  <pubDate>Fri, 01 Dec 2006 14:53:32 -0800</pubDate>
</item>
  <item>
  <title>Re: Pure object language</title>
  <link>http://socket7.net/article/passed-the-rubicon#comment-11</link>
  <author>Brett (http://socket7.net)</author>
  <description>
    &lt;p&gt;In Ruby, everything is an object.  That includes primitives like int and boolean, which allows for some very cool new ways of thinking.  So in your example, &lt;code&gt;10&lt;/code&gt; isn't a literal; it's an object representing the integer value 10.&lt;/p&gt;

&lt;p&gt;Constrast this with a C/Java/PHP style &lt;code&gt;for&lt;/code&gt; loop:&lt;/p&gt;

&lt;pre&gt;
  for (int i = 0; i &amp;lt; 10; i++) { ... }
&lt;/pre&gt;

&lt;p&gt;One has to do a bit of reasoning (however simple it may be) to figure out how many times the loop should run.  Is it 9, 10 or 11 times?  Ah... 10.&lt;/p&gt;

&lt;p&gt;But, the Ruby loop is dead simple to read and it takes nearly a third less characters to type. :)&lt;/p&gt;
  </description>
  <guid isPermaLink="true">http://socket7.net/article/passed-the-rubicon#comment-11</guid>
  <pubDate>Fri, 01 Dec 2006 11:17:46 -0800</pubDate>
</item>
  <item>
  <title>Pure object language</title>
  <link>http://socket7.net/article/passed-the-rubicon#comment-10</link>
  <author>Sebastian (http://groket.com/)</author>
  <description>
    &lt;p&gt;There are some strange language constructs.  Consider this simple loop:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;
10.times {
// do something
}
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;When did literals become objects?  Joy.&lt;/p&gt;
  </description>
  <guid isPermaLink="true">http://socket7.net/article/passed-the-rubicon#comment-10</guid>
  <pubDate>Fri, 01 Dec 2006 10:00:06 -0800</pubDate>
</item>

  </channel>
</rss>
<!-- 0.0894 -->