Re: OO purism sucks - sell me on PHP5?
| From: | tg-php at gryffyndevelopment dot com | Date: | Fri, 02 Jun 2006 15:09:20 +0000 |
| Subject: | Re: OO purism sucks - sell me on PHP5? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-237281@lists.php.net to get a copy of this message | ||
I'm kind of coming from the outside here, so forgive my ignorance on some matters. I have some
OO experience, just not with PHP and have only worked with PHP4 so again.. kind of on the outside of
all this.
Rasmus, you make a great point here. OO is structured and is all about constraints whereas PHP
tends to be rather flexible. So OO in PHP doesn't mean that it should comprompise the idea of
a structured development method. It's just part of PHP's philosophy of allowing
developers to choose their method of skinning the proverbial cat.
It seems that one of Jochem's main complaints about it isn't so much the rules and
structure, but the idea that he was told his code was wrong and he needed to redo a good chunk of
his 2 years worth of development (or any of this code) to PHP5's OO standard then a short time
later he's told that someone else had the same problem and the 'standard' was changed
to accomodate. But hey.. stuff happens. Sometimes concessions need to eventually be made when
there's no other way.
So that leads me to the 'sell' part of my altered subject line.
Rasmus said: "People are not upgrading to PHP 5 because PHP 4 works just fine for them and they
haven't yet discovered things like SimpleXML and some of the other killer features of PHP
5."
So I've read some of the new features on PHP5 and am still not sold on upgrading. As was
stated, what we've developed so far works great and there's no real incentive to upgrade.
But upgrades are inevitable so in the interest of planning for the future, I'm looking at
PHP5. Our XML routines work fine, but since you mentioned SimpleXML, I'll take a closer look
at it. What are some of the other "killer features" of PHP5 that I may be sleeping on
here.
"If it ain't broke, don't fix it" works for a while, but if there are easier
and/or better ways to do things in PHP5, I want in! So someone sell me on this from the point of
view of someone who's upgraded and has learned the joys of PHP5. So far what I've found
online has been little more than a list of new features without an idea of how much of a headache
they're going to save me in the future.
Thanks!
-TG
= = = Original message = = =
Jochem Maas wrote:
> I understand the point you made below - you have made this argument before
> and I, for one, accepted it as valid when I first read the discussion
> on internals - which is why I avoided ranting about that (and changes
> like it)
But you didn't avoid it, you used it as an example to back up your rant.
And on the OO side your argument gets shaky as well. The whole point of
OO is to add a very structured layer on top of your code to make it more
consistent and more maintainable than the equivalent procedural code.
There is nothing you can do in OO that you can't do with completely
freeform procedural code. When you choose to go OO, you choose a set of
rules and a certain code structure that by definition is going to be
somewhat constrained. The argument over exactly how constrained this
should be and where we should loosen things up will continue until the
end of time. PPP and Interfaces are all about constraints. They serve
no practical purpose whatsoever other than to add constraints.
And saying that these OO issues is slowing down PHP 5 uptake is a bit of
a red herring. We are competing against ourselves. PHP 4 works
extremely well. There is a lot of code written for it and it works. I
seriously doubt very many people are not upgrading to PHP 5 because of
some debatable edge-case OO thing. People are not upgrading to PHP 5
because PHP 4 works just fine for them and they haven't yet discovered
things like SimpleXML and some of the other killer features of PHP 5.
-Rasmus
___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.