Thank you for your 2 cents I am just learning and appreciate your comments. ----- Original Message ----- From: "Michael Hall" <[EMAIL PROTECTED]> To: "Chris Crane" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, July 16, 2002 11:13 PM Subject: Re: [PHP] Classes vs. Functions
> > There is no simple answer here. I have started using classes where I find > I am writing a lot of related functions that share similar > parameters. Database connection and queries are a good > example. Authentication is another. > > I have another class that builds forms, because I just hate the tedium of > coding HTML forms by hand. It is really just a collection of functions, > though, and could work fine as such. > > I'm still learning/exploring ... I am always guided by the principle that > whatever makes less work for me (but achieves the same result) is probably > a good thing. > > IMHO classes are best for more universal code that really can be used in > many different places. My functions tend to be more application specific. > > My 2 cents > > Michael > > On Tue, 16 Jul 2002, Chris Crane wrote: > > > Could someone please explain the difference between classes and functions > > and how to use a class. I write alot of PHP, but I never understood this at > > all. I use an include statement in many of my pages and include a file with > > a bunch of functions. For instance, I might have a function called stock(); > > In the page I am using I include the file that has this function and I call > > it like this: > > > > stock($Sym); > > > > I am wondering if I am doing it the wrong way. So I need to better > > understand classes. What is one, and why would you use it? > > > > Thanks. > > > > > > > > > > -- > -------------------------------- > n i n t i . c o m > php-python-perl-mysql-postgresql > -------------------------------- > Michael Hall [EMAIL PROTECTED] > -------------------------------- > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php