16
Jul 07

More on PHP5 adoption

Matthew Mullenweg isn’t terribly impressed with GoPHP5 or the php-internals people on the whole topic of dropping PHP4 and moving on to PHP5 and PHP6. Now, given that Matt’s the guy who founded WordPress, I reckon his opinion’s worth listening to, and given how much time I spend using vim, LaTeX and mutt, I know where he’s coming from; but he’s wrong in this instance, or at least, he’s looking at it the wrong way.

See, the difference between PHP4 and apps like LaTeX or vim is that, well, LaTeX is done. As in, it works, it’s bug-free (no, seriously, it’s as bug-free as it gets outside NASA, and a bit more so on occasion), and it does everything that its users require it to do, and well. PHP4… doesn’t. Yes, you can build apps with it, and yes, many great ones have been written. Cool. But it’s object model is fundamentally … not an object model. And it’s slower than PHP5. And if PHP itself is to survive as a language in what is a competitive space, it has a lot of work that needs doing to it. Fundamentally, it’s not done yet. It’s getting better – but to do that, it has to change, and if that means PHP4 is being left behind, I don’t think that’s worth any more tears than, say, Debian 3.0 being left behind when Debian 4.0 replaces Debian 3.1 as the stable release. It’s just how this stuff works.

Vidyut on the other hand, agrees with Matt, but more from the point of view of the end users, rather than the developers. And that’s not really all that on point, to be honest. If the developer does his or her job well, then the end user should never know what the engine is doing in the background – which, ironically enough, is his first reason as to why the PHP4->PHP5 move is a bad idea. I don’t quite get that reasoning myself. As to saying that the code clean-up that PHP5 permits is completely pointless… well, that’s just plain silly really. I mean, you can’t say that the end users shouldn’t know what the engine is doing on one hand, and on the other say that they think your code is fast and clean.

Maybe it’s a confusion over who the end users are. I mean, from the php-internals point of view, app developers are the end user; and from the developer’s point of view, the end users are, well, users.

This whole idea, though, of forking off PHP5 and leaving PHP4 alone… well, in effect, that’s what’s being done. PHP4 is being dropped. So, if you want to maintain it, do what the Joomla core team did, take a snapshot of the code and start with your maintenance and release cycles and keep PHP4 going.

I don’t think it’s a good idea though. I’ve coded in PHP5 and in PHP4, and I’ll never code in PHP4 again if I have any degree of choice in the matter. It’s too difficult to properly implement and maintain designs in it when the number of developers rises above one!


13
Jul 07

Postgres performance

For a long time now, most who’ve used both have felt that Postgres was a better database than MySQL, myself included. But until now, the stick that MySQL keep beating Postgres over the head with was performance. MySQL might be a toy database (okay, it’s moving away from that these days, but only in the last few versions and that’s not really enough dev time to be stable enough for critical stuff), but it was fast on cheap hardware, and for pragmatic web development, that meant it beat out Postgres every day of the week.

Not any more

Basicly, for the first time in a seriouly major benchmark, postgres not only outperformed mysql, but it nearly matched oracle (which was running on hardware that cost more than twice as much).

There’s also this earlier post, which basicly showed that Mysql on a single-CPU machine starts off faster than Postgres, but falls off as the number of concurrent users
rises, until it’s way behind postgres, which remains pretty invariant as the number of users rises. It also shows that postgres takes advantage of multiple CPUs better than MySQL does (up to 16 CPUs anyway, where the postgres team say they still have work to do).

Something to think about. Do you expect to ever have more than one or two users on your site? Better start with postgres so, and save yourself the cost and hassle of a later switch (I don’t care how good your database abstraction layer is, no DAL is so good that you don’t have to change your app when you switch database. Maybe more on that later.)


13
Jul 07

PHP4 End of Life

Got to hand it to the internals people, when an idea’s a good one, they run with it. First the announcement that namespaces are now officially a part of the development trunk for PHP, then this:

PHP 4 end of life announcement
[13-Jul-2007]

Today it is exactly three years ago since PHP 5 has been released. In those three years it has seen many improvements over PHP 4. PHP 5 is fast, stable & production-ready and as PHP 6 is on the way, PHP 4 will be discontinued.

The PHP development team hereby announces that support for PHP 4 will continue until the end of this year only. After 2007-12-31 there will be no more releases of PHP 4.4. We will continue to make critical security fixes available on a case-by-case basis until 2008-08-08. Please use the rest of this year to make your application suitable to run on PHP 5.

For documentation on migration for PHP 4 to PHP 5, we would like to point you to our migration guide. There is additional information available in the PHP 5.0 to PHP 5.1 and PHP 5.1 to PHP 5.2 migration guides as well.

So we will finally see adoption rates for PHP5 climb a bit. You have to wonder – will the lessons learnt here prevent the PHP4-5 problems during the PHP5-6 cycle?