There seems to be some confusion regarding weak/strong and
static/dynamic typing. Ruby is clearly dynamic-typed. But it's also
fairly strong-typed.
dlikhten:
morbiuswilters:Would that possibly be because Ruby is a dynamically typed language and has no way of checking types at all?
Check the ruby site "for java developers" they say it themselves.
That site is trying to convince you to use Ruby. They can say whatever they want, but that doesn't make it true. Not that I'm arguing with the site, but just keep that in mind.
A dynamicly typed language is something like ActionScript. You can
define properties of an object at run time. In ruby you cant do
Object.valueX=1 unless valueX= is a function defined in that class.
Sure you can. It just passes the message to the class's method_missing.
From there you're welcome to add the method at runtime. That's pretty freaking dynamic, no?
Strongly typed does not mean that type is declared at compile time. In
ruby you don't need to define what type a variable is, but you
absolutely know the type of the object at run time.
If by "you" you mean the programmer, then I'd say, not necessarily. Yes, the RTE knows the types, but duck typing is based around the fact that I don't have to care. Does it respond to the message "foo"? Super, then I can do a.foo and b.foo, without knowing or caring what the types are.