Re: wacky object idea
| From: | Francis Smit | Date: | Tue, 29 Aug 2000 08:54:23 +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-31038@lists.php.net to get a copy of this message | ||
thies@digicol.de wrote:
> On Tue, Aug 29, 2000 at 12:18:44AM +0200, Stig S. Bakken wrote:
> > Andrei Zmievski wrote:
> > >
> > > On Mon, 28 Aug 2000, Andi Gutmans wrote:
> > > > Operator overloading is one of the uglier features in C++.
I would say that was one of the best C++ features
> Java did things
> > > > better.
Hardly Java is Brain dead, and all it's ecuses for not putting those features in
are complete nonsense.
> Code is much more readable and maintainable when it uses interfaces
> > > > and not "object overloading".
The revese is true.
> 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.
>
> plz be aware that __string_value() is only called when you
> "print" the object (echo $myclass) and _not_ when you cast it to a
> string ($b = (string)$myclass). i think we need to fix that!
>
> tc
> >
> > - Stig
>
> --
>
> Thies C. Arntzen "One Big-Mac, Small Fries and a Coke!"
> Digital Collections Phone +49 40 235350 Fax +49 40 23535180
> Hammerbrookstr. 93 20097 Hamburg / Germany
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net
> For additional commands, e-mail: php-dev-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
--
Francis Smit
Knowledge By Design/OzTel
Suite 201, 683 George st
Sydney 2000 NSW
http://www.kbd.com.au
mailto:francis@kbd.com.au
Tel: +61 2 9212 1399
Fax: +61 2 9212 5727
___________________________________
m$: How can we stuff you up today?