Posted Dec 19, 2011 12:45 UTC (Mon) by HelloWorld
In reply to: Hmm...
Parent article: Cracks in the Foundation (PHP Advent)
The point is expressiveness, as usual.[...] And all thus additional unneeded manipulations are good
I don't see any gain in expressiveness here, nor do I see any "unneeded manipulations".
$z = strpos($x, $y);
if ($z === false)
auto z = boost::search(x, y);
if (it == x.end())
I dislike languages without static typing because they leave too much to the runtime, but then if we are already in realm of dynamic languages it's stupid not to use the fact that you can return objects of different types to your advantage: why do you use language with dynamic typing or duck typing if you only use things available in statically typed language???
Well, you're raising a good point, and the answer is that one just shouldn't use a dynamically typed language for anything but throw-away stuff. Doing stuff like returning either an int or a boolean spoils the way people think. They start to think that in order to obtain a convenient solution to this problem they need dynamic typing, even though that isn't so.
to post comments)