Re: wacky object idea

From: Date: Mon, 28 Aug 2000 22:18:44 +0000
Subject: Re: wacky object idea
References: 1 2 3 4 5 6 7 8 9 10 11  Groups: php.dev 
Request: Send a blank email to php-dev+get-31017@lists.php.net to get a copy of this message
Andrei Zmievski wrote: > > 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. Hm, it I just changed my opinion on this as well (the C++ operator overlodaing comparison did the trick :-). I guess I'll just rename all the toString methods in PEAR to __string_value. - Stig

« previous php.dev (#31017) next »