There are a lot of reasons why people coming back to php. The main is its a language for 'getting things done' in the real sense. A lot of languages claim that in their own way. But in my experience nothing comes close to Php and Perl in the raw power, freedom and ultra fast pace of development they offer.
The other neighboring competitors of Php, namely Python and Ruby are in the web development market with the help of frameworks. I have yet to see a serious programming shop that would bet its billion dollar business on frameworks built by others. Small libraries I can understand. But building the spirit of your business and betting its survival on a Frameworks is just out of the question.
Php is the DSL for the web. And it does its job far too well. It can be learned quickly and you can build things quickly with it. Its installed everywhere, you can get cheap hosting. Tons of document and help available.
>From when was that any criteria for success? Worse is better won a long back. Fighting that has proven to be futile.
No, it hasn't. Pragmatism won over theoretical grounds. And there are very many pragmatic reasons to prefer PHP for certain projects. No one is arguing against that.
But, with legacy and a changing market, some of those pragmatic choices come back to bite you.
There are many ways to combat this. One can evolve the language, for example. This has worked better for some languages (Javascript comes to mind) that share some of design flaws in PHP, than it has for PHP itself.
What I am arguing about, is that, we as an industry, as a community, as a profession, we shouldn't be aiming for a future where PHP is still dominant, any more than we should be aiming for a future where horses are our dominant means of transportation.
Now, maybe we can shoehorn modern features into PHP. It has been tried with PHP4 and PHP5.
But for what reason? There isn't any decent implementation of PHP (performance and stability wise). Other syntaxes aren't that hard to get accustomed to. The algorithmic complexity of core operations has changed between versions. It's not like there is any important code written in PHP, that must survive some transition, like there is with C.
Is it just to keep those on board, with no academic training, who only know PHP? If they were capable of learning PHP by themselves, would other languages really be that hard for them to use (or abuse)?
> But building the spirit of your business and betting its survival on a Frameworks is just out of the question.
People building stuff in PHP use frameworks as standard too, even if it's one they built themselves.
I've recently converted a high traffic personal project from PHP to Python with no impact in performance. I also didn't feel like I was being slowed down by Python or Flask.
Rackspace uses Django, Twisted, and Node for basically all development work. It would be nuts to not use frameworks. Do you also lament that companies have to build their business around operating systems?
I think I can shed light on what being a "DSL for the web" means.
1. PHP has built-in templating in that it's a language that gets embedded within other text files. If you go with PHP, you don't have to decide how you're going to output your content into your front-end design. So, PHP (as a language) has made the decision on templating much in the way that frameworks like Rails and Django make that decision for Ruby and Python. And it's possible to override that decision in any of those frameworks and even PHP has alternative templating engines, but it provides a built-in default decision.
2. PHP puts many useful things into global variables. One can debate the merits of this (and I'm not here to do that), but when you're new to things and can be told "anything in that form will be available in $_REQUEST['var_name']," that can get you off the ground fast - much in the same way that params[:var_name] does in Rails.
3. PHP provides built-in "routing". Heck, it's files on your filesystem. You know how a static site works? Great! You know how PHP works (in terms of routing) as well. I appreciate having reversible routers, but one can see how PHP's approach is simple, especially for new users who might have experience with static sites.
I could go on, but it would basically be re-stating the same concept. PHP as a language includes many micro-framework features in the language itself and they're usually implemented in a simple way (even if one argues that it's not an ideal way for long-term maintainability). It gets people off the ground running fast and because its micro-framework-like capabilities are widely used, it's easy to google for information.
I don't program in PHP much, but I can understand why it could be called a "DSL for the web". It has many of the things that users grab a framework to handle built into the language. I personally much prefer to work on a site in a framework in Python, Ruby, C#, or Java, but PHP's thin layer of framework tools built into the language is very easy to understand and fast to learn.
Let me add my 2 cents. I do a lot of work PHP and when I want to do web stuff it's the path of least resistance. Other languages are certainly better but they're just not better enough to get over that hump. I'm still maintaining lots of PHP code and I only have so much brain space to dedicate to languages/frameworks for exactly the same task.
I do some work in C# now but for many reasons I don't want to do web with .NET.
I've done significant work in C, C++, Perl, C#, over the years. If my brain was wiped clean of all knowledge of PHP, I'd probably end up doing most work in Python.
Personally, I strongly dislike PHP and yet I still choose it for new projects sometimes. The main reasons? Being able to use `<?php ... ?>` blocks inline with HTML, and not having to add any boilerplate import statements just to get to basic CGI functionality. Such small trivial features, but they provide enough pain relief that they're sometimes worth it.