3 ms·
>> In strongly typed languages, you can expect an exception rather than an implicit type coercion, when you pass an argument or operand of the wrong type. Scal
by chrisseaton 12y ago
>> In strongly typed languages, you can expect an exception rather than an implicit type coercion, when you pass an argument or operand of the wrong type.
Scala and Java's + operator also do implicit conversions to string. Do you think Scala and Java are both weakly typed?
You said that you think Ruby and Python are strongly typed because they don't do these implicit conversions. But they do: Ruby's Kernel#puts and Python's print convert to string.
Also, is 0.5 + 1 ok? One of those operators is a float and the other an integer. In almost every language we get an implicit conversion from integer to float. Does that mean all these languages are weakly typed? Or is conversion to string some kind of exception for some reason?