|
Posted by Jerry Stuckle on 06/12/07 08:49
gosha bine wrote:
> On 11.06.2007 20:58 Schraalhans Keukenmeester wrote:
>>
>> Imho implicit obj2str conversion is meaningless, and though I have abused
>> the construct myself a few times I am glad they corrected this behaviour.
>> Having to define your own stringifier forces you to think about and
>> implement what is logically the proper meaning of a conversion to an
>> otherwise incompatible type.
>
> That's exactly the point Zend developers are constantly missing. It is
> not the responsibility of language designers to remove constructs that
> may seem "useless" to them. An application programmer is the one who
> decides which syntax is appropriate for her particular task. The job of
> the language designer is to provide clean and consistent mechanism for
> generating any possible expression, including "useless" ones. You don't
> let a taxi driver decide where you're going to go, do you?
>
No, but you let a taxi driver decide how you get there.
> As to this specific case, removal of implicit toString is especially
> stupid, because _every other_ type in php and _every other_ comparable
> programming language supports it.
>
No, every other type in php doesn't support it. When was the last time
you tried to convert an object to an int, for instance?
And as for every other comparable programming language - no they don't.
But who cares? Other languages have features PHP doesn't have, and
PHP has features they don't have. It's comparing apples and oranges.
Personally, I've found the silent conversion allows for sloppy
programming and problems (like the one which started this thread). I'm
glad to see the implicit conversion is gone.
But if you really want it, the developers left a way for you to do so.
Good for them.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
[Back to original message]
|