2 ms·
> "weak typing" usually means a type system (static or dynamic) where there are many implicit coercions going on. "strong typing" requires these casts to be wri
by cbd1984 12y ago
> "weak typing" usually means a type system (static or dynamic) where there are many implicit coercions going on. "strong typing" requires these casts to be written explicitly.
This makes no sense, because both of those definitions assume the runtime and/or compiler has the same amount of type information available to it, and the only difference is what the runtime and/or compiler chooses to do with it.
Weakly typed languages have less type information, either because they never had it or because they allowed the programmer to throw it away.
Casts and conversions are not the same thing: A cast throws away type information so the same data can be used in a different way, a conversion uses the type information to change the data (or prove no change is needed) in order to use it in a different way.
C has casts, Javascript has conversions. C is weakly typed, Javascript is strongly dynamically typed.