Re: classes v. functions
| From: | Andu | Date: | Fri, 18 Jul 2003 22:19:50 +0000 |
| Subject: | Re: classes v. functions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-155848@lists.php.net to get a copy of this message | ||
--On Friday, July 18, 2003 14:28:02 -0700 Chris Shiflett <shiflett@php.net> wrote:
--- Andu <undo@archeopterix.com> wrote:Say I have a database class with all kinds of functions for connection, data manipulation, errors, etc: $db = new db_sql; $db->connect(); $db->do_this(); $db->do_that(); How would that be different from an include file with a bunch of functions doing the same thing? Is there any performance benefit one way or the other? I used EZ_Sql which is cool but didn't seem to speed things up in comparison to the said include file. Still don't see the beef. Brad recommended I spend even more time with google looking for OOP, maybe that's why I'm so confused:).This may show my ignorance or my refusal to take for granted something I don't fully understand but I have a hard time figuring out the advantage of using classes as opposed to just functions.They are entirely different. While OO fans will find my over-simplification disgusting, a class is basically a way to associate data with the functions that manipulate that data.
ChrisRegards, Andu Novac