Why are weakly-typed languages still being actively developed?
https://softwareengineering.stackexchange.com/questions/115704
-
03-11-2019 - |
题
I wonder why are weakly-typed languages still being actively developed. For example, what benefit can one draw from being able to write
$someVar = 1;
(...) // Some piece of code
$someVar = 'SomeText';
instead of using the much different, stongly-typed version
int someInt = 1;
(...)
string SomeString = 'SomeText';
It is true that you need to declare an aditional variable in the second example, but does that really hurt? Shouldn't all languages strive to be strongly-typed since it enforces type-safety at compile time, thus avoiding some pitfalls in type-casting?
没有正确的解决方案