Question

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?

No correct solution

Licensed under: CC-BY-SA with attribution
scroll top