[Phpwm] OO?

Paul Cooper pgc at openadvantage.org
Sun Dec 11 22:24:16 GMT 2005


On Sat, 2005-12-10 at 02:27 +0000, Jono Bacon wrote:
> Hi all,
> 
> I was wondering - how much does anyone actually use the OO
> functionality that is in PHP, particularly PHP5. Although I have done
> OO stuff before in C++, I find myself largely writing fairly
> procedurally in PHP, and only really using OO when using PEAR.
> 
> What are your thoughts?

It would depend on what kind of app I was coding: a high traffic website
or a web-application.

For a high traffic content based website (something which is generally
free to access, where traffic is uncontrollable / unpredictable). I
would, in general use procedural code, and try to keep things as light
as possible. 

For a for pay web application (whether on the internet or for someones
intranet) I would use more OO code, for example HTML_Template_Flexy,
DB_DataObject, HTML_QuickForm, and whatever else from PEAR or elsewhere
that seemed useful. In this situation it's all about how quickly you can
code, not how quickly the code runs (within reason of course) and
developing stuff with OO just makes things easier and quicker. In PHP4
using loads of OO wasn't that efficient but where we have control over
the server load, either because we're charging, or because we spec the
server as part of the solution, it doesn't matter so much.

Nathan Wallace wrote a great essay about writing applications in PHP all
the way back in March 2000.

http://www.e-gineer.com/v1/articles/php-hackers-paradise.htm

HTH,

Paul

>    Jono
> 
> _______________________________________________
> Phpwm mailing list
> Phpwm at mailman.lug.org.uk
> http://mailman.lug.org.uk/mailman/listinfo/phpwm
> 




More information about the Phpwm mailing list