You are here: Re: [PHP] Classes or functions « PHP « IT news, forums, messages
Re: [PHP] Classes or functions

Posted by Brent Baisley on 10/19/05 23:46

It's really a matter of comfort level and opinion. There can be
strong arguments either way. Using just functions will be faster,
although the speed difference may be minimal and not noticeable.
Using just functions can be easier and quicker to develop, especially
for small projects.

But, using classes will allow your project to scale much better, if
only by giving you the ability to create variable scopes so that
variable and function names don't conflict. Classes will also allow
you to standardize your function names. For instance, you can have
multiple functions called getList(), but in different classes. Then
any time you need to retrieve a list of data, you call the getList()
function from the appropriate class (i.e. companies, contacts,
phones, etc).

That's a very basic example. My personal opinion is that you cannot
build a large scale project that will be easily maintainable without
using classes and object oriented concepts. That's not to say it
can't or hasn't been done (it has).

On Oct 19, 2005, at 12:42 PM, Khorosh Irani wrote:

> What this methods are better for php4? classes or functions
> Does it better to use classes when I can write the codes with
> functions?
> Excuseme for my bad english
>

--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация