[Phpwm] OO?

David Goodwin david at codepoets.co.uk
Sat Dec 10 08:26:25 GMT 2005


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?


During / just after Uni, I could only think in OO, and obviously found 
php4 rather lacking. And a lot of my early php was done in an OO manner.

Since doing more procedural stuff, seeing other people's code etc and 
just gaining more experience, I think that for most cases OO adds too 
much complexity and baggage to what could otherwise be rather simple 
code. For instance, I used to believe it was necessary to create an 
object to encapsulate the underlying data (e.g. an address book entry) - 
obviously it's far more flexible and efficient to pass around an array 
of some sort instead.

We (Kat&I) are doing all our new development on php5, and although we're 
not using all the OO features, we are finding that e.g. Exceptions are 
something we missed.

I think the OO model is great for e.g. frameworks and could possibly 
have a useful part to play in larger applications.


David.
-- 
David Goodwin

[ david at codepoets dot co dot uk ]
[ http://www.codepoets.co.uk       ]



More information about the Phpwm mailing list