Poor typing
Poor typing - a type system where the expression type can be automatically changed if the context requires it. This means, among other things. Automatic conversions between some types.
One advantage of poor typing compared to strong typing is that it requires less developer effort because the compiler or interpreter implicitly executes certain conversions. However, the disadvantage may be that poorly typed systems capture fewer errors at compile time, and these errors may remain undetected even after testing. For example, in the PHP language, strings "1000" and "1e3" give equality comparisons because they are implicitly converted to floating-point numbers - although they are different strings. In JavaScript and PHP, there is a special comparison operator (identity) === that verifies that both arguments are of the same type and have the same value.
Example in PHP: $ number = 1; if ("1" == $ number) { // despite the comparison with the text, the condition is true because the number is cast to the string type }
wiki
Comments
Post a Comment