>
> > As a converting Java-to-Ruby programmer, I still
> get hung up on
> > typing.  The same is true of all my Java friends
> who are moving on
> > to loosely typed languages.  Somehow, we all yearn
> for some
> > strictness--especially with regard to defining
> interfaces.  Strange,
> > isn't it?  It's almost like we're all obsessed
> with writing
> > contracts.  Maybe we should have been lawyers.
> 
> Ruby is *not* loosely typed. It is dynamically
> typed. It's type
> checking is better than C++'s, which has holes in
> it, making it
> _weakly_ typed.
> 

Semantics.  Without the best choice of words, I meant
the same that you do.  From this point on, I will
always say "dynamically" typed.

> Secondly, with dynamic languages you still need to
> think in terms of
> interfaces. Just because they are not checked at
> compile time does not
> mean they are not their or that they are not
> important.
> 

Obviously.  But, the interface is less strict with
regard to type.  The code inside a method can work
with any object that implements the messages it is
trying to send.  And, the expected messages aren't
documented in the interface definition.  (Keep in
mind, I'm not complaining about any of this--just
mentioning difference).  As I mentioned earlier, this
tends to confuse a lot of Java programmers, who are
programmed to define a sort of protocol contract in an
interface.  Again, this is not Ruby's fault at all. 
It's just an adjustment that we need to make when
coming from a strictly typed language like Java to a
dynamically typed language like Ruby.




__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/