<?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: Adding Type Checking to Ruby</title>
	<atom:link href="http://www.codecommit.com/blog/ruby/adding-type-checking-to-ruby/feed" rel="self" type="application/rss+xml" />
	<link>http://www.codecommit.com/blog/ruby/adding-type-checking-to-ruby</link>
	<description>(permanently in beta)</description>
	<lastBuildDate>Mon, 09 Jan 2012 20:21:24 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Russell Balest</title>
		<link>http://www.codecommit.com/blog/ruby/adding-type-checking-to-ruby/comment-page-1#comment-5381</link>
		<dc:creator>Russell Balest</dc:creator>
		<pubDate>Fri, 03 Jun 2011 15:04:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/ruby/adding-type-checking-to-ruby#comment-5381</guid>
		<description>About 5 minutes ago while walking and reflecting on 5 years of Ruby and Rails programming, it occurred to me that static type checking, which I once worried about, has somehow, mysteriously become a forgotten issue in my domain.  The kinds of runtime errors that most often occur in my world would not be prevented by static type-checking in any case - like unexpected data and logic errors.   Granted I&#039;m not writing aviation software.  But, the larger irony is that the overall occurrence of bugs of any variety is a fraction of what it was when I was programming regularly in C/C++.   The reason could be simply that I&#039;m writing less lines of code, and thus have less chance of making errors.   Another reason is that there are really only about half a dozen &#039;types&#039; to keep straight in Ruby and similar languages.  Whereas in C++ there are technically infinitely many &#039;types&#039;.

Nonetheless I can see where the above approach might be useful to me if one could enable it during development and then disable in production.</description>
		<content:encoded><![CDATA[<p>About 5 minutes ago while walking and reflecting on 5 years of Ruby and Rails programming, it occurred to me that static type checking, which I once worried about, has somehow, mysteriously become a forgotten issue in my domain.  The kinds of runtime errors that most often occur in my world would not be prevented by static type-checking in any case &#8211; like unexpected data and logic errors.   Granted I&#8217;m not writing aviation software.  But, the larger irony is that the overall occurrence of bugs of any variety is a fraction of what it was when I was programming regularly in C/C++.   The reason could be simply that I&#8217;m writing less lines of code, and thus have less chance of making errors.   Another reason is that there are really only about half a dozen &#8216;types&#8217; to keep straight in Ruby and similar languages.  Whereas in C++ there are technically infinitely many &#8216;types&#8217;.</p>
<p>Nonetheless I can see where the above approach might be useful to me if one could enable it during development and then disable in production.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Kern</title>
		<link>http://www.codecommit.com/blog/ruby/adding-type-checking-to-ruby/comment-page-1#comment-5358</link>
		<dc:creator>Jon Kern</dc:creator>
		<pubDate>Tue, 15 Mar 2011 23:04:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/ruby/adding-type-checking-to-ruby#comment-5358</guid>
		<description>Cedric, while there may be some very *special* cases where you need an API call to be this rigorous, it is *not the norm* in Ruby. And for good reason, as this makes otherwise flexible Ruby turn into the bloated nightmare that are most static typed languages.</description>
		<content:encoded><![CDATA[<p>Cedric, while there may be some very *special* cases where you need an API call to be this rigorous, it is *not the norm* in Ruby. And for good reason, as this makes otherwise flexible Ruby turn into the bloated nightmare that are most static typed languages.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cedric</title>
		<link>http://www.codecommit.com/blog/ruby/adding-type-checking-to-ruby/comment-page-1#comment-5357</link>
		<dc:creator>Cedric</dc:creator>
		<pubDate>Tue, 15 Mar 2011 21:29:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/ruby/adding-type-checking-to-ruby#comment-5357</guid>
		<description>@Eric Monday,

The point is that you want to be told at compile time whether the arguments being passed respond to &quot;+&quot;, and the only way to do this is to specify a type.</description>
		<content:encoded><![CDATA[<p>@Eric Monday,</p>
<p>The point is that you want to be told at compile time whether the arguments being passed respond to &#8220;+&#8221;, and the only way to do this is to specify a type.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric</title>
		<link>http://www.codecommit.com/blog/ruby/adding-type-checking-to-ruby/comment-page-1#comment-5355</link>
		<dc:creator>Eric</dc:creator>
		<pubDate>Mon, 14 Mar 2011 15:35:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/ruby/adding-type-checking-to-ruby#comment-5355</guid>
		<description>Why do you care if the arguments coming in are a string? Surely all you care is that they respond to the + method and can be concatenated together. Why limit yourself to only supporting strings? The type is not the issue - the methods that the objects coming in support are what matters. Quack quack quack.

I appreciate it is only some simple example code - but my point still stands. Or does it?</description>
		<content:encoded><![CDATA[<p>Why do you care if the arguments coming in are a string? Surely all you care is that they respond to the + method and can be concatenated together. Why limit yourself to only supporting strings? The type is not the issue &#8211; the methods that the objects coming in support are what matters. Quack quack quack.</p>
<p>I appreciate it is only some simple example code &#8211; but my point still stands. Or does it?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Guilherme Garnier</title>
		<link>http://www.codecommit.com/blog/ruby/adding-type-checking-to-ruby/comment-page-1#comment-5287</link>
		<dc:creator>Guilherme Garnier</dc:creator>
		<pubDate>Fri, 18 Feb 2011 10:42:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/ruby/adding-type-checking-to-ruby#comment-5287</guid>
		<description>I understand the value of refactoring tools like Eclipse´s for static typed languages like Java. I use a lot of these refactorings with Java, and I think they are very helpful, but renaming methods and attributes isn´t 100% guaranteed, even in Java:

1 - if you use JSF or Spring Webflow, you have Java code called from XHTML and XML files
2 - if you do Criteria queries with Hibernate (not JPA 2.0 style), you write code like this:

criteria.add(Restrictions.eq(&quot;name&quot;, &quot;John&quot;));

Your refactoring tool won´t find your &quot;name&quot; attribute inside a string.

3 - If you use Reflection, you´re pretty much in the same situation as in a dynamic language.

I know IntelliJ refactorings are more advanced than Eclipse´s, but I don´t know if they can cover the 3 situations above (maybe the first one).</description>
		<content:encoded><![CDATA[<p>I understand the value of refactoring tools like Eclipse´s for static typed languages like Java. I use a lot of these refactorings with Java, and I think they are very helpful, but renaming methods and attributes isn´t 100% guaranteed, even in Java:</p>
<p>1 &#8211; if you use JSF or Spring Webflow, you have Java code called from XHTML and XML files<br />
2 &#8211; if you do Criteria queries with Hibernate (not JPA 2.0 style), you write code like this:</p>
<p>criteria.add(Restrictions.eq(&#8220;name&#8221;, &#8220;John&#8221;));</p>
<p>Your refactoring tool won´t find your &#8220;name&#8221; attribute inside a string.</p>
<p>3 &#8211; If you use Reflection, you´re pretty much in the same situation as in a dynamic language.</p>
<p>I know IntelliJ refactorings are more advanced than Eclipse´s, but I don´t know if they can cover the 3 situations above (maybe the first one).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Kern</title>
		<link>http://www.codecommit.com/blog/ruby/adding-type-checking-to-ruby/comment-page-1#comment-5283</link>
		<dc:creator>Jon Kern</dc:creator>
		<pubDate>Thu, 10 Feb 2011 04:40:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/ruby/adding-type-checking-to-ruby#comment-5283</guid>
		<description>Daniel, while I can appreciate your point of view, I think it is misguided. I would advise against doing it except under very strict circumstances (I found it in 3 spots in my production code on one healthcare project -- all having to do with message handling and checking what we received...). 

More here: http://technicaldebt.com/?p=735</description>
		<content:encoded><![CDATA[<p>Daniel, while I can appreciate your point of view, I think it is misguided. I would advise against doing it except under very strict circumstances (I found it in 3 spots in my production code on one healthcare project &#8212; all having to do with message handling and checking what we received&#8230;). </p>
<p>More here: <a href="http://technicaldebt.com/?p=735" rel="nofollow">http://technicaldebt.com/?p=735</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nucc</title>
		<link>http://www.codecommit.com/blog/ruby/adding-type-checking-to-ruby/comment-page-1#comment-5259</link>
		<dc:creator>Nucc</dc:creator>
		<pubDate>Wed, 19 Jan 2011 18:55:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/ruby/adding-type-checking-to-ruby#comment-5259</guid>
		<description>I guess this type checking is not a bad stuff, and yes, it could be really slow in production environment. But it can be very good under development, when it acts like an assert in C or C++. In Rails I have very usual String Integer comparing problem, that is very annoying sometimes, because printing it out shows good result (it calls the to_s method of the Integer on debugging).</description>
		<content:encoded><![CDATA[<p>I guess this type checking is not a bad stuff, and yes, it could be really slow in production environment. But it can be very good under development, when it acts like an assert in C or C++. In Rails I have very usual String Integer comparing problem, that is very annoying sometimes, because printing it out shows good result (it calls the to_s method of the Integer on debugging).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ragmaanir</title>
		<link>http://www.codecommit.com/blog/ruby/adding-type-checking-to-ruby/comment-page-1#comment-4966</link>
		<dc:creator>Ragmaanir</dc:creator>
		<pubDate>Thu, 22 Apr 2010 15:27:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/ruby/adding-type-checking-to-ruby#comment-4966</guid>
		<description>I have to underline Martin Vahi&#039;s comment. I also have been using ruby for quite some time as well as c++, C#, Java (and i have some experience in Scala, Prolog, Scheme etc). And i also saved a lot of development and debugging time because type checking caught errors as soon as possible so i did not have to spend hours searching for the origin of the errors. I would like to see some extensions to the type checking framework for attributes:

    attr count: Integer, default: 0
    attr name: [Symbol,String]
    attr enabled: Boolean # =&gt; generates method: enabled?
</description>
		<content:encoded><![CDATA[<p>I have to underline Martin Vahi&#8217;s comment. I also have been using ruby for quite some time as well as c++, C#, Java (and i have some experience in Scala, Prolog, Scheme etc). And i also saved a lot of development and debugging time because type checking caught errors as soon as possible so i did not have to spend hours searching for the origin of the errors. I would like to see some extensions to the type checking framework for attributes:</p>
<p>    attr count: Integer, default: 0<br />
    attr name: [Symbol,String]<br />
    attr enabled: Boolean # =&gt; generates method: enabled?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin Vahi</title>
		<link>http://www.codecommit.com/blog/ruby/adding-type-checking-to-ruby/comment-page-1#comment-4942</link>
		<dc:creator>Martin Vahi</dc:creator>
		<pubDate>Fri, 26 Feb 2010 23:09:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/ruby/adding-type-checking-to-ruby#comment-4942</guid>
		<description>As of February 2010 I&#039;ve been using Ruby for a few years, I&#039;ve also worked in Java, Delphi and had C++ as my favorite programming language in the past. I specially loved to do speed optimizations and play with template metaprogramming. (That is to say, I&#039;ve had many &quot;religions&quot;.)  I&#039;m not sure that I have fully understood the main values of duck typing, mainly due to lack of experience with it, but as I have spent about 7 months working with PHP(5) and JavaScript, mostly JavaScript, it seems to me that in practice run-time type checks for simple types like strings, hashtables, arrays, integers, has saved me a lot of time. 

If a method has to receive a string or a hashtable, but due to a typo or my fuzziness receives something else, then it saves considerable amount of development time, if that error has been reported.  On the other hand, in the &quot;duck typing&quot; side I actually &quot;study the duck&quot; more thoroughly in the debug mode. For instance, whether the hashtable/object instance has all of the required fields, whether their values are within the domain, etc. Actually, in the case of my JavaScript code, the type checks for the simple types, string, int, etc., occur only in debug mode. So, I think that the truth relies again somewhere in between. As of February 2010 I think that It&#039;s good to have some type checks, but it should be optional and in &quot;the appropriate place&quot;.

Regards,
Martin (Vahi)</description>
		<content:encoded><![CDATA[<p>As of February 2010 I&#8217;ve been using Ruby for a few years, I&#8217;ve also worked in Java, Delphi and had C++ as my favorite programming language in the past. I specially loved to do speed optimizations and play with template metaprogramming. (That is to say, I&#8217;ve had many &#8220;religions&#8221;.)  I&#8217;m not sure that I have fully understood the main values of duck typing, mainly due to lack of experience with it, but as I have spent about 7 months working with PHP(5) and JavaScript, mostly JavaScript, it seems to me that in practice run-time type checks for simple types like strings, hashtables, arrays, integers, has saved me a lot of time. </p>
<p>If a method has to receive a string or a hashtable, but due to a typo or my fuzziness receives something else, then it saves considerable amount of development time, if that error has been reported.  On the other hand, in the &#8220;duck typing&#8221; side I actually &#8220;study the duck&#8221; more thoroughly in the debug mode. For instance, whether the hashtable/object instance has all of the required fields, whether their values are within the domain, etc. Actually, in the case of my JavaScript code, the type checks for the simple types, string, int, etc., occur only in debug mode. So, I think that the truth relies again somewhere in between. As of February 2010 I think that It&#8217;s good to have some type checks, but it should be optional and in &#8220;the appropriate place&#8221;.</p>
<p>Regards,<br />
Martin (Vahi)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roger</title>
		<link>http://www.codecommit.com/blog/ruby/adding-type-checking-to-ruby/comment-page-1#comment-4415</link>
		<dc:creator>Roger</dc:creator>
		<pubDate>Tue, 23 Dec 2008 18:27:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.codecommit.com/blog/ruby/adding-type-checking-to-ruby#comment-4415</guid>
		<description>http://74.125.95.132/search?q=cache:_7SQZf5WRQQJ:www.cs.umd.edu/~jfoster/ruby.pdf+ruby+static+parameters+library&amp;hl=en&amp;ct=clnk&amp;cd=2&amp;gl=us
lists an attempt at compile time ruby checking.  That&#039;s cool.</description>
		<content:encoded><![CDATA[<p><a href="http://74.125.95.132/search?q=cache:_7SQZf5WRQQJ:www.cs.umd.edu/~jfoster/ruby.pdf+ruby+static+parameters+library&amp;hl=en&amp;ct=clnk&amp;cd=2&amp;gl=us" rel="nofollow">http://74.125.95.132/search?q=cache:_7SQZf5WRQQJ:www.cs.umd.edu/~jfoster/ruby.pdf+ruby+static+parameters+library&amp;hl=en&amp;ct=clnk&amp;cd=2&amp;gl=us</a><br />
lists an attempt at compile time ruby checking.  That&#8217;s cool.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

