Hacker News new | comments | show | ask | jobs | submit login

> That is its strength.

No. That's it's weakness. Programming languages are not like natural languages. PHP did not emerge spontaneously from conversations amongst PHP programmers -- people actually sat down and wrote code. When that happened, they had the choice to exercise some degree of higher thought. They did not do so.

PHP is a perfect example of how local optimality -- slap on the first thing that "works" -- can lead to wildly suboptimal global outcomes. PHP is a system that is a constant state of partial failure.

> And that is why it is the most popular programming language.

This is demonstrably false. Folk didn't adopt PHP because of some hand-wavy, post hoc, revisionist bullshit about linguistic evolution. They did so because in the late 1990s it was not possible to run multiple mod_perl applications on a single Apache process, but mod_php could do so.

That's it. Perl's horse wasn't shod. The rest is merely a painful, expensive, misbegotten parade of path dependency.

> They did so because in the late 1990s it was not possible to run multiple mod_perl applications on a single Apache process, but mod_php could do so.

When it comes to single factors explaining its success in the 1990s, the one I've heard cited more often is that you could embed PHP into HTML documents with the <?php ...> kind of deal, and a lot of shared hosts enabled that by default, making it by far the easiest way to get server-side scripting up and running.

Plus the deployment model: "here's your FTP login".

Yep, trivial deployment model and trivial stack integration so every free host or ISP providing 20MB "web hosting" to users could give out PHP execution as well.

The implicit assumption here is that the world doesn't change. PHP comes from the world of Perl, C, and ASP/VBScript. Procedural programming, embedded HTML, etc. It's impossible to predict the future.

Other languages have evolved as well; Python has changed significantly from it's earliest incarnations. And, during the time of early PHP, Python was a complete failure as web language.

Again, Python et al have not evolved. They have continued to be modified and refined by the deliberate application of thought, particularly the kind of insightful, discursive thought that programming language design calls for.

The point is, Python wasn't (and perhaps isn't) perfect. Mistakes were made. Fixes introduced. PHP continues to be modified and refined as well. PHP developers are hard working developers with a difficult job; I can't help but think you're being insulting to them.

The difference is that at each stage, Python's designers have exercised more global reasoning than PHP's.

The PHP bar for inclusion, for most of its life, seems to have been "it compiles".

I don't think it's possible to directly compare PHP and Python and not draw the conclusion that PHP was basically slapped together out of any old thing that came to hand without any degree of planning or foresight.

The problem is that many early design decisions were made when PHP was a small personal project with the goal of accomplishing something immediately. It wasn't intended to be object-oriented. But that was a long time ago. Many of the points made about PHP design are ancient decisions and difficult to change because of backwards compatibility.

I'd say it's entirely unfair and incorrect to say the bar for inclusion has been "it compiles". Even some of the decisions made for PHP4, which I disagreed with, were debated endlessly.

Take, for example, the introduction of namespaces into PHP -- it got a lot of flack for using an additional character but if you study the design carefully it's nearly impossible for it work any other way in PHP. You might look at that and say there was no planning or foresight (or that it was simply the easiest solution) but that betrays the truth.

This. +1000 if I could.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact