<?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: Ruby is dynamically AND strongly typed</title>
	<atom:link href="http://www.rubyfleebie.com/ruby-is-dynamically-and-strongly-typed/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rubyfleebie.com/ruby-is-dynamically-and-strongly-typed/</link>
	<description>Because programming should be fun</description>
	<lastBuildDate>Thu, 15 Jul 2010 19:48:22 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Dynamic, static, weak and strong in languages &#171; Altug Sahin&#39;s Blog</title>
		<link>http://www.rubyfleebie.com/ruby-is-dynamically-and-strongly-typed/comment-page-1/#comment-1022</link>
		<dc:creator>Dynamic, static, weak and strong in languages &#171; Altug Sahin&#39;s Blog</dc:creator>
		<pubDate>Thu, 15 Jul 2010 19:48:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.rubyfleebie.com/ruby-is-dynamically-and-strongly-typed/#comment-1022</guid>
		<description>[...] came across this interesting post. Here is the [...]</description>
		<content:encoded><![CDATA[<p>[...] came across this interesting post. Here is the [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frank</title>
		<link>http://www.rubyfleebie.com/ruby-is-dynamically-and-strongly-typed/comment-page-1/#comment-864</link>
		<dc:creator>Frank</dc:creator>
		<pubDate>Tue, 15 Sep 2009 04:26:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.rubyfleebie.com/ruby-is-dynamically-and-strongly-typed/#comment-864</guid>
		<description>Dilruk, 

in your example dynamic/static doesn&#039;t apply. It&#039;s the Strong/Weak aspect of typing that is affected. In ruby, your example would throw out an exception. In a weakly typed language, it would try to mix the two types... In most cases I guess it would give something like &quot;This is a number7&quot;

Thanks for your comments everyone (I&#039;m just 2 years late) !</description>
		<content:encoded><![CDATA[<p>Dilruk, </p>
<p>in your example dynamic/static doesn&#8217;t apply. It&#8217;s the Strong/Weak aspect of typing that is affected. In ruby, your example would throw out an exception. In a weakly typed language, it would try to mix the two types&#8230; In most cases I guess it would give something like &#8220;This is a number7&#8243;</p>
<p>Thanks for your comments everyone (I&#8217;m just 2 years late) !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dilruk</title>
		<link>http://www.rubyfleebie.com/ruby-is-dynamically-and-strongly-typed/comment-page-1/#comment-826</link>
		<dc:creator>Dilruk</dc:creator>
		<pubDate>Tue, 24 Feb 2009 21:45:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.rubyfleebie.com/ruby-is-dynamically-and-strongly-typed/#comment-826</guid>
		<description>A = &quot;This is a number&quot;
What would be the result for A = A + 7 in a Dynamically typed language?</description>
		<content:encoded><![CDATA[<p>A = &#8220;This is a number&#8221;<br />
What would be the result for A = A + 7 in a Dynamically typed language?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: txt &#187; Dynamic/Static/Strong/Weak Types</title>
		<link>http://www.rubyfleebie.com/ruby-is-dynamically-and-strongly-typed/comment-page-1/#comment-308</link>
		<dc:creator>txt &#187; Dynamic/Static/Strong/Weak Types</dc:creator>
		<pubDate>Wed, 25 Jul 2007 18:16:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.rubyfleebie.com/ruby-is-dynamically-and-strongly-typed/#comment-308</guid>
		<description>[...] Original Article [...]</description>
		<content:encoded><![CDATA[<p>[...] Original Article [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shadowfiend</title>
		<link>http://www.rubyfleebie.com/ruby-is-dynamically-and-strongly-typed/comment-page-1/#comment-305</link>
		<dc:creator>Shadowfiend</dc:creator>
		<pubDate>Sat, 14 Jul 2007 23:34:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.rubyfleebie.com/ruby-is-dynamically-and-strongly-typed/#comment-305</guid>
		<description>But that&#039;s often what&#039;s meant with weak. Weak means that there is a weak distinction between the types (more or less). In C, that&#039;s particularly evident because you get virtually no distinction between pointer types -- they&#039;re all integers at the end of the day, and you can do whatever you want with them. Casting lets you achieve just about anything, with no checking until you get a segfault in your running program :)</description>
		<content:encoded><![CDATA[<p>But that&#8217;s often what&#8217;s meant with weak. Weak means that there is a weak distinction between the types (more or less). In C, that&#8217;s particularly evident because you get virtually no distinction between pointer types &#8212; they&#8217;re all integers at the end of the day, and you can do whatever you want with them. Casting lets you achieve just about anything, with no checking until you get a segfault in your running program :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Giuca</title>
		<link>http://www.rubyfleebie.com/ruby-is-dynamically-and-strongly-typed/comment-page-1/#comment-304</link>
		<dc:creator>Matt Giuca</dc:creator>
		<pubDate>Fri, 13 Jul 2007 16:35:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.rubyfleebie.com/ruby-is-dynamically-and-strongly-typed/#comment-304</guid>
		<description>So from some of these comments (the guy who overloaded Ruby + and the guy who said C is weakly typed) - it seems like we can classify strong/weak as being a property of the OPERATORS themselves, not the type system! (For the most part).

I wouldn&#039;t classify C as having a particularly weak type system. It lets you implicitly cast numbers around (eg. (int)3 + (float)4.7 =&gt; (float)7.7), but that&#039;s about it. For instance, C won&#039;t let you go &quot;3&quot; + 4 and give you 7 - which a truly &quot;weak&quot; type system will give you.

Oh no, C is far worse - it isn&#039;t _weak_, it&#039;s _unsafe_! The 3rd classification after dynamic/static and weak/strong is safe/unsafe. In C if you do &quot;3&quot; + 4, you get ... a pointer 3 bytes past the end of the string! This is usually unacceptable in modern languages so it doesn&#039;t happen in most. But just a point, I wouldn&#039;t consider that &quot;weakness&quot;.

Sorry for getting off-topic. Oh, a very good article though!</description>
		<content:encoded><![CDATA[<p>So from some of these comments (the guy who overloaded Ruby + and the guy who said C is weakly typed) &#8211; it seems like we can classify strong/weak as being a property of the OPERATORS themselves, not the type system! (For the most part).</p>
<p>I wouldn&#8217;t classify C as having a particularly weak type system. It lets you implicitly cast numbers around (eg. (int)3 + (float)4.7 =&gt; (float)7.7), but that&#8217;s about it. For instance, C won&#8217;t let you go &#8220;3&#8243; + 4 and give you 7 &#8211; which a truly &#8220;weak&#8221; type system will give you.</p>
<p>Oh no, C is far worse &#8211; it isn&#8217;t _weak_, it&#8217;s _unsafe_! The 3rd classification after dynamic/static and weak/strong is safe/unsafe. In C if you do &#8220;3&#8243; + 4, you get &#8230; a pointer 3 bytes past the end of the string! This is usually unacceptable in modern languages so it doesn&#8217;t happen in most. But just a point, I wouldn&#8217;t consider that &#8220;weakness&#8221;.</p>
<p>Sorry for getting off-topic. Oh, a very good article though!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shadowfiend</title>
		<link>http://www.rubyfleebie.com/ruby-is-dynamically-and-strongly-typed/comment-page-1/#comment-303</link>
		<dc:creator>Shadowfiend</dc:creator>
		<pubDate>Fri, 13 Jul 2007 13:59:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.rubyfleebie.com/ruby-is-dynamically-and-strongly-typed/#comment-303</guid>
		<description>@yriafelc -- yes, but in that situation, you&#039;ve changed the `unmentioned&#039; semantics of +to_str+ -- namely, that an object that has that method is, for all intents and purposes, a string, while +to_s+ means that it can be represented as one. Personally, I think String#+ should use +to_s+ rather than +to_str+. But then again, that&#039;s what string interpolation is for, so whatever.</description>
		<content:encoded><![CDATA[<p>@yriafelc &#8212; yes, but in that situation, you&#8217;ve changed the `unmentioned&#8217; semantics of +to_str+ &#8212; namely, that an object that has that method is, for all intents and purposes, a string, while +to_s+ means that it can be represented as one. Personally, I think String#+ should use +to_s+ rather than +to_str+. But then again, that&#8217;s what string interpolation is for, so whatever.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jman</title>
		<link>http://www.rubyfleebie.com/ruby-is-dynamically-and-strongly-typed/comment-page-1/#comment-302</link>
		<dc:creator>jman</dc:creator>
		<pubDate>Fri, 13 Jul 2007 12:54:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.rubyfleebie.com/ruby-is-dynamically-and-strongly-typed/#comment-302</guid>
		<description>Excellent explanation of a easily misunderstood concept!</description>
		<content:encoded><![CDATA[<p>Excellent explanation of a easily misunderstood concept!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephan Schmidt</title>
		<link>http://www.rubyfleebie.com/ruby-is-dynamically-and-strongly-typed/comment-page-1/#comment-301</link>
		<dc:creator>Stephan Schmidt</dc:creator>
		<pubDate>Fri, 13 Jul 2007 08:27:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.rubyfleebie.com/ruby-is-dynamically-and-strongly-typed/#comment-301</guid>
		<description>Most of those discussions are wrong.

The key concept to grasp in strong versus weak typing is that there is a distinction between reference typing and object typing. Java has static typed references and static typed objects.

Person me = new Person(&quot;me&quot;)

Both the reference and the object are static typed. People usually call this strong typing.

me = Person.new

Here the reference is dynamic typed and the object is static typed (although in Ruby objects can change their appearance during run-time). Dynamic typed references with static typed objects people usually call weakly typed. 

Groovy is makes the distinction more difficult. It support both dynamic and static references, just as needed.

def me = new Person(&quot;me&quot;)

and

Person me = new Person(&quot;me&quot;)

are both legal Groovy code. The first with dynamic typed references and the second with a static typed reference.

I&#039;ve written extensivly about the distinction more than &lt;a href=&quot;http://stephan.reposita.org/archives/2006/03/29/weak-versus-strong-languages-who-wins-the-fight/
&quot;&gt;a year ago&lt;/a&gt;.

Peace
-stephan

-- 
Stephan Schmidt :: stephan@reposita.org
Reposita Open Source - Monitor your software development
http://www.reposita.org 
Blog at http://stephan.reposita.org - No signal. No noise.</description>
		<content:encoded><![CDATA[<p>Most of those discussions are wrong.</p>
<p>The key concept to grasp in strong versus weak typing is that there is a distinction between reference typing and object typing. Java has static typed references and static typed objects.</p>
<p>Person me = new Person(&#8220;me&#8221;)</p>
<p>Both the reference and the object are static typed. People usually call this strong typing.</p>
<p>me = Person.new</p>
<p>Here the reference is dynamic typed and the object is static typed (although in Ruby objects can change their appearance during run-time). Dynamic typed references with static typed objects people usually call weakly typed. </p>
<p>Groovy is makes the distinction more difficult. It support both dynamic and static references, just as needed.</p>
<p>def me = new Person(&#8220;me&#8221;)</p>
<p>and</p>
<p>Person me = new Person(&#8220;me&#8221;)</p>
<p>are both legal Groovy code. The first with dynamic typed references and the second with a static typed reference.</p>
<p>I&#8217;ve written extensivly about the distinction more than <a href="http://stephan.reposita.org/archives/2006/03/29/weak-versus-strong-languages-who-wins-the-fight/<br />
">a year ago</a>.</p>
<p>Peace<br />
-stephan</p>
<p>&#8211;<br />
Stephan Schmidt :: <a href="mailto:stephan@reposita.org">stephan@reposita.org</a><br />
Reposita Open Source &#8211; Monitor your software development<br />
<a href="http://www.reposita.org" rel="nofollow">http://www.reposita.org</a><br />
Blog at <a href="http://stephan.reposita.org" rel="nofollow">http://stephan.reposita.org</a> &#8211; No signal. No noise.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: yriafelc</title>
		<link>http://www.rubyfleebie.com/ruby-is-dynamically-and-strongly-typed/comment-page-1/#comment-299</link>
		<dc:creator>yriafelc</dc:creator>
		<pubDate>Thu, 12 Jul 2007 13:10:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.rubyfleebie.com/ruby-is-dynamically-and-strongly-typed/#comment-299</guid>
		<description>
x = &#039;3&#039;
x = x + 3 # Error!


but:

Class Fixnum
  def to_str
    self.to_s
  end
end

x = &#039;3&#039;
x = x + 3 # x = &#039;33&#039;
</description>
		<content:encoded><![CDATA[<p>x = &#8216;3&#8242;<br />
x = x + 3 # Error!</p>
<p>but:</p>
<p>Class Fixnum<br />
  def to_str<br />
    self.to_s<br />
  end<br />
end</p>
<p>x = &#8216;3&#8242;<br />
x = x + 3 # x = &#8216;33&#8242;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
