Here is a presentation on why Yahoo! chose to go with PHP as a the server-side scripting language. I found it interesting that their own benchmarks apparently show mod_perl is better than PHP every time. And their reasoning makes sense. Except:
Why not Perl?
- FreeBSD support and performance is great
- huge CPAN library
- we already use it for offline processing
- There’s More Than One Way To Do It (TMTOWTDI)
- poor sandboxing, easy to screw up server
- wasn’t designed as web scripting language
They got the “Pros” right. But they mis-stepped on two of the “Cons”.
- Java wasn’t “designed as a web scripting language”, but that wasn’t one of the reasons they didn’t choose it.
- They say TMTOWTDI was a “Con”, but that is essentially “the way other people write code”. If this is really an issue, then you enforce a particular coding style. And, from looking at PHP code, I can tell you that the problem is just as bad there.
Worse, by using PHP instead of Java or Perl, they’ve guaranteed two sets of code: PHP for online and Perl for offline. The presentation indicates that duplicate processing is done off-line.
I would’ve also recommended they look at AxKit since it allows much better separation of data and logic than PHP will let you have. PHP allows too much spaghetti and it is easy to get confused about where the data is and the code is. Or when code is really data.