|
Posted by Schraalhans Keukenmeester on 06/12/07 11:47
At Tue, 12 Jun 2007 10:22:23 +0200, gosha bine let h(is|er) monkeys type:
> 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.
It's not about being useless, it's about being meaningless without a
specific definition of what conversion should be like. Any construction
conceivable, logically sound or not, will be deemed useful by at least
some people, at some point.
The default string conversion hitherto available in PHP comes across as a
stopgap solution offering programmers a coincidental and semantically
debatable shortcut. There are valid tools available allowing you to find
out about anything you want to know about an object or its class, there is
no need for the implicit tostring conversion.
> 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?
I don't tell a taxi driver how to get at the destination best, how to
drive, when to shift gear and what his car should look like. I use a cab
because it's -based on sound empirical evidence- a well-defined service
using the tools and tricks required for the trade. I can expect a car with
a driver who knows how to operate a vehicle, has a fair knowledge of how
to get somewhere fastest or most efficiently. If there's a change in how
taxis operate, I'd hope that change isn't based on customer whim.
> 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.
PHP is as PHP does. There's plenty of constructs PHP has that other
languages miss, and each has its own merits. If all languages only mimic
others we'll end up with the first generation T-ford colour chart. You can
choose any colour, as long as it's black.
At time I'd wish I could use list constructs and logic Prolog style, yet
I'd frown if Zend PHP decided to conform PHP to Prolog's way of doing
things.
There are traits in C I don't particularly like, but few if any of them
fail to make sense in logical terms. And yes I am glad C's more or less
calmed down and set in stone by now (start the flames people ;-)), and PHP
will come to that level someday, or not. Right now it's a highly dynamical
and slightly volatile language, and each cycle the true shape of PHP
becomes clearer. Access baggage is cut off, faults corrected and omissions
plugged.
But that's all just my opinion of course.
--
Schraalhans Keukenmeester - schraalhans@the.Spamtrapexample.nl
[Remove the lowercase part of Spamtrap to send me a message]
"strcmp('apples','oranges') < 0"
[Back to original message]
|