Re: wacky object idea

From: Date: Tue, 29 Aug 2000 10:53:22 +0000
Subject: Re: wacky object idea
References: 1 2 3 4 5 6 7 8 9 10 11 12  Groups: php.dev 
Request: Send a blank email to php-dev+get-31046@lists.php.net to get a copy of this message
Francis Smit wrote: > > 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. I don't intend to start a C++ bashing contenst, but I've dealt with some programming languages that do a lot of overloading, and some that don't. I have found "the WTF factor" as Rasmus calls it to be much higher in languages and projects using lots of overloading. Sure, it's cool to use operators for everything, it may make the code easier to read, but it also makes it harder to understand because it makes the semantics more obscure. Example: elems = str / ":"; Easy to read, cool to write, but what does it do? It's doing this: elems = str.split(":"); This form doesn't leave you with any doubt. Conclusion: if you want your code to be understood by others, avoid overloaded operators. - Stig

« previous php.dev (#31046) next »