At 09:58 07/05/2004 +0900, you wrote:
>James Britt <jamesUNDERBARb / neurogami.com> wrote in message 
>news:<409A3F01.6070302 / neurogami.com>...
> > About a month ago I interviewed a number of candidates for a Java
> > developer position.
>
>James... dude... why do you never call me when these things come up?
>A month ago I was sitting here, on the couch watching endless "Buffy"
>DVDs from NetFlix, eating bon-bons and busily being unemployed.
>
><sob> Don't you love me anymore?!?
>
> > Aside from the usual tech questions, I asked them what they didn't like
> > about the language.  Most of them had a hard time thinking of anything.
>
>Oh, heck... I was a shoe-in for that job.  I could have given you an
>earful. ;-)
>
> > And this is not a jab at Java; I would think that anybody deeply
> > familiar with a language would have a few things things they disliked
> > about it, even if, on the whole, they loved the language.
>
>Good point.  So, I hereby proclaim this the first annual J.B. Ruby
>Roast.  Come on, cough up.  What don't you like about Ruby?
>
>I'll start it off with my favorite: the missing type checker.  I'd
>like "-c" to also check types, as much as it can.  It should be
>doable, too; Ruby will never be strongly typed, but it should be
>possible to Duck-check the Duck-types in a large number of cases.
>
>--- SER

I tend to use assertions when I want stronger checking:

if $DEBUG then
   def assert( &block )
     return true if block.call()
     assertion_failure
   end
else
   def assert()
   end
end

   xxx
   assert { x.kind_of? y }
   xxx

With checks turned off there is still a small overhead. I
don't know how to totally remove it.

Assertions can check other things, not just type.
Additionnaly they have some value as "comments".

I believe that I would introduce "Design by Contract" to
any one that would reject Ruby because of type checking (lack of).
With assertions you can do type checking and more.
See also http://www.c2.com/cgi/wiki?DesignByContract

Yours,

Jean-Hugues



-------------------------------------------------------------------------
Web:  http://hdl.handle.net/1030.37/1.1
Phone: +33 (0) 4 92 27 74 17