[thelist] PHP resource...

Beau Hartshorne beau at members.evolt.org
Thu May 30 11:27:07 CDT 2002


I noticed that your link points to a bunch of OO PHP articles.

After reading these three articles:

http://www.zend.com/zend/art/mistake.php
http://www.zend.com/zend/art/mistake1.php
http://www.zend.com/zend/art/mistake2.php

I got a little confused about OOP and PHP. The author at Zend says
(rather authoritatively):

<snip src="http://www.zend.com/zend/art/mistake1.php#Heading14">

The OO paradigm is a wonderful concept. It has numerous benefits, the
most notable being the ability to reuse code easily. However, as we've
all come to understand: 'PHP is not an OO language'.

While PHP does offer adequate object oriented support, it is neither
efficient nor wise to use its object oriented features when you can make
use of other methods to achieve the same result. The reason for this is
that PHP's OO support is not full blown.

While most of the major elements are present, PHP still lacks some of
the more advanced features (such as protected membersor private
variables) that a "true" OO language (For example, C++ , Java) would
have.

Nor is the code behind PHP's OO support very efficient or fine tuned.
This means that when you use the OO paradigm with PHP, you may in fact
be slowing down the execution time of your programs considerably.

</snip>

So, I like OO programming. I learnt how to program with Java. But I
understand that PHP is not designed form the ground up to be OO. I have
written some OO PHP code, but it seems hack-ish. With PHP, I'm never
sure when I should create an object, or when I should make an API.

After reading those three articles at Zend, I'm thinking that I should
simply program in PHP the same way that you'd program in C.

Thoughts, comments?

Thanks,

Beau

> I just came across this resource as I was on my journey learning about
> classes and I thought I'd pass it along:
>
> http://php.resourceindex.com/Documentation/Class_Design_and_OOP/
>
> It seems to be a good repository of articles.





More information about the thelist mailing list