You are here: Re: [PHP] functions vs classes « PHP « IT news, forums, messages
Re: [PHP] functions vs classes

Posted by Lars B. Jensen on 10/12/84 11:13

> Novice PHPer, and i am wondering why one would use a function instead of a
> class (or object)? They seem to server very similar in use.

All depends on the specific use and situation - pros and cons by both
models, for speed and performance, I mostly use optimized functions sorted
out in structured files for easy reuse, rather than objects. PHP5 seem to
embrase object orientation more, so lets see if a war starts again - it's
religion. Think before you program.

> The way I see it, is a function if for repeated use in a project specific
> manner, where as a class could be used for many projects.

It's precisely the same, if you include a file with your class or include a
file with your functions, whats the difference ? none.

--
Lars B. Jensen, Internet Architect

CareerCross Japan
Japan's premier online career resource for english speaking professionals

http://www.careercross.com

 

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

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