"Larry Garfield" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> On Tuesday 19 December 2006 19:24, Tony Marston wrote:
>
>> I have written a large application which uses the OO features of PHP 4, 
>> and
>> the same code runs untouched with PHP 5. There is no advantage in making
>> use of some of these fancy new features in PHP 5, so I just don't bother.
>
> I couldn't disagree more.  While I've yet to write any exception-based 
> code,
> for me the magic getter/setter functionality in PHP 5's OOP is reason 
> enough
> to switch all on its own.

Not for me it isn't.  I don't use getters and setters to access individual 
properties, I use arrays. Much simpler.

>  Even if you don't want to write Java-style OO with
> crazy nested hierarchies (which you shouldn't be doing in PHP), true
> Singletons can be quite nice.  The simplicity offered by passing objects 
> as
> references is nice.

But it is not a good enough reason on its own.

>  There's a lot more to PHP 5's OOP than just "let's add
> exceptions because Java has them", and that's not even counting the 
> non-OOP
> improvements.
>
> Your point falls flat anyway.  Yes, most PHP 4 code will keep on humming 
> in
> PHP 5.  That doesn't mean the PHP 5 features have "no advantage", it just
> means that they're not mandatory for code to work in PHP 5.  There's 
> plenty
> that you can do in PH P 5 that you couldn't do in PHP 4, but if all you 
> know
> is PHP 4 then you don't know what they are yet.

If you bothered to read what I wrote you will see that I *DO* know PHP5 as 
the software I provide runs on both I have two PCs, one with PHP4 and one 
with PHP5 so I can ensure it runs on both.

>  Your argument is logically false.

I disagree. This topic is about the question "are the new OO features in PHP 
5 worth the effort of upgrading?" to which my answer is *NO*. It is possible 
to write OO code in PHP4, and that code will run exactly the same in PHP5. 
Most of the new OO features in PHP5 are just fancy eye-candy which have very 
little practical advantage, so there is no point in modifying existing PHP4 
code to take advantage of those features as it would be all cost and no 
benefit.

-- 
Tony Marston
http://www.tonymarston.net
http://www.radicore.org 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to