Re: wacky object idea
| From: | Andrei Zmievski | Date: | Mon, 28 Aug 2000 16:37:59 +0000 |
| Subject: | Re: wacky object idea | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-30986@lists.php.net to get a copy of this message | ||
On Mon, 28 Aug 2000, Andi Gutmans wrote:
> Operator overloading is one of the uglier features in C++. Java did things
> better. Code is much more readable and maintainable when it uses interfaces
> and not "object overloading". You might lose a lot of what PHP is about
> when implementing this "cool" feature. You might move PHP coders into
> writing unreadable code.
This is one of the times when I completely agree with Andi. We have
__string_value method support and I suppose it's a nice enough feature
for debugging, but I don't see it being used for much more than that.
Adding other kinds of automatic object conversions is just going to lead
to more mess. Andi is right when he says that using interfaces would be
a better approach.
-Andrei
When we eliminate the impossible, whatever remains,
however improbable, must be true. -- Sherlock Holmes