Originally posted by: Zugzwang152 Highly interactive and complex sites very rarely use PHP, in fact most use aspx that i can tell, even the AT forums now... but there are very few of these sites comparatively, as compared with the millions and millions of individuals and small to medium sized companies that can leverage PHP a lot easier and cheaper than a commercial language.
But! The whole point of this thread is that it's not just big buzzwordy commercial solutions vs. PHP. There are other solutions and Rails seems like an extremely excellent one.
In the end though, I can't fathom a PHP program/script that would take a significant amount of code more than something written in a different language.
I can. Look at any of the Rails examples and show me a PHP equivalent done in less code or even nearly the same amount of code, while still achieving the separation of layers and other things that make it more clean, sane, easy to test, etc.
I've done significant amounts of web stuff in both PHP and Python and with PHP I constantly run into things that feel painful, while not so much in Python.
Silly things like not being able to do function_that_returns_array(someargs)[0] and instead having to do an array_pop around it or whatever (I'm pulling this out of memory but you get the basic idea). PHP's heredoc string syntax is awesome for doing <<<SQL
INSERT yadda
THIS is correctly SYNTAX HIGHLIGHTED IN VIM! woohoo!
SQL;
But you can ONLY end a heredoc with a semicolon. Want a comma or some other stuff? <<<SQL
TOO bad
SQL
, some more args...); # barf
Escaping db query strings is ugly and painful. Gotta check for these "magic" (ugh) quotes and then maybe addslashes or stripslashes. Of course if you're doing anything serious you should probably use something higher-level like Pear DB, but the add-on dance gets pretty old, and for something as intrinsic as formatting SQL queries, it's kinda silly that the built-in stuff is so flaky.
I'm babbling and I should cut myself off here. The specific reasons don't even matter, really. It's the generalities that matter, and for PHP to ever be a "generally" good programming language, it would have to reinvent itself. My main issue is that it's always promoted as being the end-all be-all of web development and that it's perfectly ok to write entire web applications in it.