[Rails] 12 / 16 = 0
Jeroen Houben
jeroen at terena.nl
Sun Apr 2 09:26:06 GMT 2006
Jonathan Weiss wrote:
> Jeroen Houben wrote:
>> Gábor SEBESTYÉN wrote:
>>>
>>> On 2006.04.02., at 10:16, Jeroen Houben wrote:
>>>
>>>> Just thought it was weird that Ruby doesn't automatically cast ints
>>>> to floats. Seems so un-rubyish
>
> No, this is exactly why Ruby is a strong dynamically typed language.
> Doing autoconversion is a very bad thing as unintentioned things can
> happen.
>
> If I tell the computer to dived two integers, I get an integer back. If
> I tell the computer to contatinate two strings I get a string back. If I
> tell the computer to add a string to a number Ruby should tell me "I
> can't do it".
>
> That's the whole point abouot strongly typed languages!
That's the kind of answer I was looking for. So I can definitely see why
strongly typed languages are safe and predictable and all, but why
(just out of interest) does PHP (and in the future phython?) have it?
Jeroen
More information about the Rails
mailing list