RE: Multiple Inheritance

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am sorry for you, Richard, for the vast miss-understanding of OO.

Regards,

Justin Palmer
__________________________
KISS (Keep It Simple, SEARCH)!
Google::getUri( http://www.google.com );
Archives::getUri( http://marc.theaimsgroup.com/?l=php-general );



-----Original Message-----
From: Richard Lynch [mailto:ceo@xxxxxxxxx] 
Sent: Friday, December 10, 2004 10:33 AM
To: Chris Boget
Cc: PHP General
Subject: Re:  Multiple Inheritance


> What are some of the things you guys do to get around the fact that
> classes in php4 can't do multiple inheritance?

What I do is not use classes.

At all.

:-)

As a Lisp programmer of over a decade, I think I can safely say I am an
OO proponent.

Yet, every time I sit down to program a web application in PHP, I find
very little (read: nothing) that I want to use OO *for*.

I'm not creating a whole bunch of anything, so the ability to make lots
of the same object never seems useful.

I'm not trying to solve an AI problem. :-)

I've already got simpler and more clear tools to write good code, such
as include and functions.

The overhead of OO is particularly ill-suited to a web environment where
run-times need to be in seconds or less.

I rarely have anything that wants to inheret a lot of behaviour from
something else, and then do something just a bit different.

I mostly just want to grab some data, massage it a bit, format it
nicely, and present it in HTML format.

To tell the truth, 95% of the "OO" code I run into written in PHP is
[bleep].

It seems like very very very little thought has gone into the Design of
the classes to be used -- Only the most straight-forward mapping of
everything under the sun into a class is utilized.

Inheritence is seldom used, even when it would be appropriate.

None of the power of OO is used.

OO seems to be used, badly, to separate chunks of code that would be
better served as simple straight-forward functions, include files, or
just plain old one-line PHP rather than 20 lines of a 'class' that does
nothing much.

I find myself digging through 5 files to un-wrap something that turns
out to be a whole lot of nothing when all is said and done.  Ugh!

How is that "Good Code"?!

I'm sure there must be some better PHP OO code out there.  Maybe that 1%
is worth all my pain trying to dig through the maundering mess most PHP
coders make of their application.

But to me, it feels like our profession has decided to force everybody
to use OO, no matter how inappropriate OO might be for the task at hand,
or how inexperienced the lead developer.

In a crude analogy, this would be like forcing every contruction company
to be their own architect, and to write their own blueprints.

OO code written by an inexperienced programmer usually ends up being
convoluted and buggy, rather than the clean, well-organized ideal it
strives for -- Worse, it seems TO ME that this code ends up being even
more convoluted and buggy than it would have been if the same
inexperienced programmer just wrote the code as straight-forward
procedural PHP with a few includes and functions.

*GOOD* OO code requires the experience and analysis of an expert to
build a sensible framework, leveraging the common behaviours and
properties of similar code -- or, more rarely but often more
spectacular, what seems like DIS-similar behaviours and properties that,
with a shift in view-point, turn out to be "the same"

Alas, what seems to be "de reguire" is for some beginner to sit down and
write the very first thing that comes into their mind as a 'class' and
just keep doing that over and over, but never actually *USING* OO for
its benefits.

I will probably be reviled as a heretic, but there it is.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux