Hi,

Saturday, July 19, 2003, 7:08:55 AM, you wrote:
A> This may show my ignorance or my refusal to take for granted something I 
A> don't fully understand but I have a hard time figuring out the advantage of 
A> using classes as opposed to just functions. I am certainly new to php and 
A> at first sight classes seemed to cut a lot of corners but so do functions 
A> (with which I have more experience). The more I read about classes the 
A> deeper the confusion. Anyone can enlighten me?

A> Regards, Andu Novac
 
Classes are good in that they group functions and variables into a re
usable block. Trying to do everything by just loading functions will
eventually lead to naming and include hell once you start doing
complex things.
PHP might not be an oo language but it sure helps me keep things
togeher. I tend to make classes that do a function like
authentication, I just need to include authClass.inc and fire it up
and all my auth work is done. i know I can create other functions as
they won't clash with the ones in the auth class.

Another great thing with classes is you don't have to make common
variables global all the time.

If you haven't used any other type of OOP then you won't have any
problems trying to make PHP look like java, you can just grab the
benifits with whats available :-)

-- 
regards,
Tom


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

Reply via email to