David Vallner
11/11/2006 8:06:00 PM
Charles Oliver Nutter wrote:
> Joel VanderWerf wrote:
>> James McGovern blogged:
>>> Type safety
>>
>> Whuh? Ruby's not type safe?
>>
>
> Yeah, and exactly how does running on Java help that? Maybe we should
> add static typing to JRuby! There's a great idea!
>
Running on Java would of course do bugger all for that. However, I am
one of the proponents of -some- (optional) ahead-of-time contract
checking for Ruby. Static typing is one method of contract checking, and
an easy one to implement, and in optional form wouldn't be rubbing me
the wrong way. YMMV, and it's a vapourware proposition anyway - IIRC, it
was pondered for Ruby 2.0, but there's no sign of that in any material
describing Ruby 1.9 changes, so I'm not holding my breath.
Duck typing fans will probably howl over the above comment, but if I've
seen code behaviour do -any- type checking (mostly in the standard lib),
it's based on #is_a?, and not on #respond_to?, so apparently most duck
typing preachers really mean "I don't want to bother with any checks".
David Vallner