2 ms·
But that isn't what we're talking about. Changing a number to a string and using it as a string is exactly as bad as changing a string to a number and using it
by imanaccount247 12y ago
But that isn't what we're talking about. Changing a number to a string and using it as a string is exactly as bad as changing a string to a number and using it as a number.
- cbd1984 12y ago> Changing a number to a string and using it as a string is exactly as bad as changing a string to a number and using it as a number. Both of those are examples of strong typing in action.
- imanaccount247 12y agoNo, they are both examples of weak typing in action. Both of those are an error in a strong type system. That's the point.
- cbd1984 12y agoOnly if the strong type system is specified to return errors on those kinds of mismatches, as opposed to using the type information to perform a conversion and give another result which is just as well-defined as an error. That's the point: Strong typing ensures all results are well-defined, as the result of a specification, and it uses type information to do that. Weak typing throws away type information, so it can no longer uphold such specifications.
- imanaccount247 12y agoYour definition is one that you made up though. Most people use the actual definitions of words.