RE: [PHP] What's the use in OOP?
| From: | Stephen Craton | Date: | Mon, 29 Mar 2004 22:25:26 +0000 |
| Subject: | RE: [PHP] What's the use in OOP? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-181734@lists.php.net to get a copy of this message | ||
Thanks for all the replies. I've mostly been reading over at PHP-Builder. I
read one of the articles by Luis Argerich, but since I was only skimming
through the article, I may have missed something and read it wrong.
I used OO in my chat script (can be found at http://php.melchior.us) but it
really seemed like a waste since it was such a small basic script. I never
really find myself re-needing code except for database connectivity and
calling the database and stuff like that.
Thanks again for all the replies and helpful information.
Thanks,
Stephen Craton
http://www.melchior.us
- -----Original Message-----
- From: Chris Shiflett [mailto:shiflett@php.net]
- Sent: Monday, March 29, 2004 4:53 PM
- To: Stephen Craton; 'PHP List'
- Subject: Re: [PHP] What's the use in OOP?
-
- --- Stephen Craton <webmaster@melchior.us> wrote:
- > I've been reading up on object oriented programming in PHP for a while
- > now and I just don't get what's the use in using it. It supposedly
- > makes it faster, but I don't really see how in any of my scripts.
-
- Makes it faster in what way? I'm curious to know what you've been reading.
-
- Using objects is generally faster for the programmer and slower for the
- computer. YMMV.
-
- > What's the advantage of OOP anyway, and why are so many people using
- > it now?
-
- To really understand this, you need to use it. No one can tell you in one
- or two lines enough information to explain the entire paradigm or even
- convince you of its merits.
-
- The one-liner attempt of mine would be something like:
-
- It helps you associate data with functions that use that data.
-
- There are lots of other things, of course. One method of learning about
- this would be to take every OO term (encapsulation, namespacing, etc.) and
- find a really good explanation of the term.
-
- Hope that helps.
-
- Chris
-
- =====
- Chris Shiflett - http://shiflett.org/
-
- PHP Security - O'Reilly
- Coming Fall 2004
- HTTP Developer's Handbook - Sams
- http://httphandbook.org/
- PHP Community Site
- http://phpcommunity.org/