By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,722 Members | 1,904 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,722 IT Pros & Developers. It's quick & easy.

object oriented php - primer

P: n/a
Could anyone give me a tip about a good primer on object oriented php
programming - why I should use it, the benefits, the drawbacks, the bugs, the
glory?

And, should I upgrade to php5 before starting to use it (to avoid two
standards)?

--
Sandman[.net]
Jul 17 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
"Sandman" <mr@sandman.net> wrote in message
news:mr**********************@individual.net...
Could anyone give me a tip about a good primer on object oriented php
programming - why I should use it, the benefits, the drawbacks, the bugs, the glory?

I think this site has everything you need to know:
www.google.com

Yeesh.

Garp
Jul 17 '05 #2

P: n/a
MBR
Actually, I have a similar question, and I don't think Google will have
the answer for me. The question is not how to do OO in PHP. That I
can figure out on my own. I've done OO in straight C before C++ was
ubiquitous. I've written OO code in C++ and Java for over 10 years.
BUT my experience with web applications is that the associated server-
side code is usually fairly trivial, and structuring things in a class
hierarchy is generally overkill.

So, my question is not how do people do object oriented programming in
PHP, but rather why? Under what circumstances does it really provide
any benefit?

Mark
mb*@arlsoft.com

Garp wrote:
"Sandman" <mr@sandman.net> wrote in message
news:mr**********************@individual.net...
Could anyone give me a tip about a good primer on object oriented php
programming - why I should use it, the benefits, the drawbacks, the bugs,


the
glory?


I think this site has everything you need to know:
www.google.com

Yeesh.

Garp


Jul 17 '05 #3

P: n/a
MBR wrote:
So, my question is not how do people do object oriented programming in
PHP, but rather why? Under what circumstances does it really provide
any benefit?


For me, the reason to use OO in PHP is the same as in any other language: OO
makes things better organized and easier to maintain.

There is to inherent advantage in using OO above procedural or other types
of programming except that it gives a better organization of your code,
making it much easier to reuse, maintain and publish.

Why do you use OO in Java? (Note: one can easily write a completely
procedural program in Java).

Berislav

--
If the Internet is a Marx Brothers movie, and Web, e-mail, and IRC are
Groucho, Chico, and Harpo, then Usenet is Zeppo.
Jul 17 '05 #4

P: n/a
In article <Et*******************@news-text.cableinet.net>,
"Garp" <ga***@no7.blueyonder.co.uk> wrote:
Could anyone give me a tip about a good primer on object oriented php
programming - why I should use it, the benefits, the drawbacks, the bugs,
the glory?


I have no idea what so ever, and it would even be stupid of me to reply to
your post.

Garp


Ok, thanks anyway.

--
Sandman[.net]
Jul 17 '05 #5

P: n/a

"Sandman" <mr@sandman.net> wrote in message
news:mr**********************@individual.net...
In article <Et*******************@news-text.cableinet.net>,
"Garp" <ga***@no7.blueyonder.co.uk> wrote:
Could anyone give me a tip about a good primer on object oriented php
programming - why I should use it, the benefits, the drawbacks, the bugs, the glory?


I have no idea what so ever, and it would even be stupid of me to reply to your post.

Garp


Ok, thanks anyway.

--
Sandman[.net]


I'm sorry, but the question was as wide open as you could have made it. This
isn't the right forum to ask for such general advice (you didn't even
specify PHP for the OOD part), and I'm glad you got the point I made,
however badly you spelled "whatsoever".

Garp
Jul 17 '05 #6

P: n/a

"Berislav Lopac" <be************@dimedia.hr> wrote in message
news:ca**********@ls219.htnet.hr...
MBR wrote:
So, my question is not how do people do object oriented programming in
PHP, but rather why? Under what circumstances does it really provide
any benefit?
For me, the reason to use OO in PHP is the same as in any other language:

OO makes things better organized and easier to maintain.

There is to inherent advantage in using OO above procedural or other types
of programming except that it gives a better organization of your code,
making it much easier to reuse, maintain and publish.

Why do you use OO in Java? (Note: one can easily write a completely
procedural program in Java).

Berislav


All good points; simply put, OOD is simply a way of organising solutions to
problems. It's just a good way to think about the problems you encounter
every day in your work and this is evident in all the languages that either
integrated OO in their middle age or grew out of the concept itself. I do it
because I only have to solve problems once. When I don't do it, after the
third or fourth cut & paste I wish I had.

Garp
Jul 17 '05 #7

P: n/a
I've written a couple medium sized programs (~10,000 lines) in php and
one of the main reasons I use OO is to keep the namespace clean. Most
of my apps have done a lot of db queries so you get a lot of $query
and $row variables. This can become a problem if your using a lot of
require statements to import code and not using OO or functions at the
least. Classes are also a lot easier for me to read and use than a
bunch of multi-dimensional arrays for passing data around. However, I
don't think OO is really about encapsulation as much as it is about
abstraction, but I'll leave that discussion alone. I don't find a lot
of reasons to have hierarchies of classes in the apps I've worked on
in php.
Jul 17 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.