From: Robert Klemme Date: 2010-11-13T04:50:20+09:00 Subject: Re: Ruby vs PHP for the web On 11/12/2010 05:35 PM, Mike Stephens wrote: > Robert Klemme wrote in post #960960: >> >> There seems to be some disagreement what exactly "strongly" and >> "weakly" means here. > > To me it's pretty straightforward. An object of Class A cannot be > treated as an object of Class B - the language system detects and > prevents this. Ruby does not follow this approach. It uses duck typing > which is the opposite. So you are claiming that Ruby is weakly typed. It is not. Ruby does not allow an instance of A to be treated as an instance of B. Duck typing really only means that Ruby does not have interfaces and uses dynamic typing. In other words, all instances answering a particular set of methods can be used in a piece of code, e.g. def append(a,b) a << b end append $stderr, "Last warning!" append ARGV, "--help" append [1,2,3], 4 See also Joel's example from C. This is not possible in Ruby. Kind regards robert