RE: Multiple Inheritance

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

 



Hi,

Have you ever written a project and then moved to the next noticing that
you are doing some of the same things from last project (connecting to a
database, reading a file, writing to a file, etc...)?

Have either of you ever written a for loop? Of course, you have.

Have you ever written the for loop and then noticed (after you uploaded
the script to the server) that you wrote the loop with syntax errors?

If so, why not use an ArrayIterator?  If not, then you are a master in
the PHP realm.  I would have to assume that even the most experienced
php developer has done this once or twice in there life. It all amounts
to a waste of precious programming time. When this occurs.  Especially
when TIME = MONEY.

What if you were to build an application around the MySQL database.  You
have just finished the project and you are taking it to your boss.  You
get there and then your boss says, "you know what I would rather use
Oracle as our database".  With this situation you have, potentially,
wasted many hours writing the MySQL version.  What are you going to do
now, say something like, "Sorry boss, my application I designed is not
flexible enough for me to switch db's at this time.", as your promotion
for completing the project goes down the drain.

There are large arguments about both, I grew up on OO so that is how I
program and that is what I know.  Procedural does not even make sense to
me.  Using low-level functions and process over and over again, when the
functions and process can be written once and used on many projects over
and over again.

Also, do you ever go back and maintain projects that you have worked on
a year later.  If you used objects you would know exactly what you are
walking into, I doubt you can say that with a procedural state of mind.

Resources to learn more:

www.phppatterns.com
wact.sf.net
http://www.sitepoint.com/forums/forumdisplay.php?f=147
www.martinfowler.com

There are more resources: -> google is your friend.

I would put Pear, but personally I think that it started out to be a
good idea and has turned into a disaster, IMO. (Sorry to any Pear
lovers, I still think Pear is better than procedural).

I don't care if you program in procedural or oo, but I would like you to
educate yourself in the pluses and minuses of both.  If you have not
learned oo and know nothing about it, then learn it might surprise you.

I think the main problem is that PHP is still young in the OO world, it
grew up on procedural.  With this in mind there is no OO Standard that
people follow, like in Java, or .NET.  Pear is trying to address this
issue, but if you are not a Pear believer then you use some other
Standard, and so the cycle of NO STANDARD revolves.

And after saying all that, I will say that there are times on very small
projects that procedural does make more sense.

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: Mike [mailto:php@xxxxxxxxxxxx] 
Sent: Friday, December 10, 2004 11:08 AM
To: 'PHP General'
Subject: RE:  Multiple Inheritance


Richard,

Thank you for that.

I've been writing PHP apps for a while now but would not concider myself
an "expert". I just enjoy doing it and I know a fair bit about what I'm
doing. One thing I never quite got into (with PHP) is OO. Why - because
nothing I ever did really seemed to make sense as OO. I could easily
write a function that'd get called one or a few times and that was about
it. There didn't seem to be a need for objects to be used and re-used
and my scripts shouldn't ever run long enough for me to take advantage
of OO's abilities.

I was worried that I "didn't get it" (and I still might not... But
that's another issue) but maybe I'm not too far off the mark. It's just
useful to see other people's opinions on this topic. 

Maybe I'll be burned at the stake along with you... ;)

-M


> > 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.
> 
[snip] 
> I will probably be reviled as a heretic, but there it is.
> 

-- 
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