Hacker News new | ask | show | jobs
by j_col 5095 days ago
PHP is a big legacy open source project, worked on by many volunteers whenever they can spare the time, just like any other open source project.

It is wildly successful despite this and many other bugs.

I only wish that the people who spend as much time attacking PHP and it's developers endlessly would instead focus some of that energy into helping to improve PHP, but I guess some of us are just negatively charged.

Sad that we have yet another anti-PHP posting hitting the front of HN in as many days, let the hating re-commence (again)...

5 comments

Responses like this to people who don't like PHP are just as bad as the people constantly and loudly attacking it. Neither accomplishes anything other than building animosity.

Your suggestion that people improve PHP instead of attacking it is naive. PHP is, as you said, a big legacy open source project. As a result of that, it's basically impossible to make the extreme, breaking changes that many people (me included) think would be required to make it a reasonable competitor to the existing options. (And the PHP community is not especially inclined to change. It took years for short array syntax to get added to the language. If something as obviously beneficial as that is going to be hotly debated, making real, breaking changes is impossible.)

Faced with the alternatives of trying to radically change PHP (which is, as I said above, impossible) or to use and improve other languages and frameworks, I think the choice is obvious. It was one thing 5-10 years ago when there weren't necessarily good or mature alternatives, but we have many choices now. In my opinion, it makes very little sense to use something with as much extraordinarly painful legacy baggage as PHP unless you have an exceptionally good reason for doing so.

After 5+ years of eloquent, smart programmers* posting long, well researched screeds about what's deeply broken with PHP's design at the most fundamental levels, there is no other conclusion to be reached. The only way to improve PHP is to replace it, and we have a long way to go to get there.

* Note that I am not including myself in this list. But any trivial search for "what's wrong with PHP", much less "PHP sucks" produces 5+ years of very bright, articulate, sometimes downright famous programmers making this same point about PHP. Most recently Jamie Zawinski at http://www.jwz.org/blog/2011/05/computational-feces/#comment...

> After 5+ years of eloquent, smart programmers* posting long, well researched screeds about what's deeply broken with PHP's design at the most fundamental levels, there is no other conclusion to be reached.

Issuing holy decrees from their ivory towers more like. Meanwhile, lots of tremendously successful companies doing real work in PHP each and every day, at the coal face, where it matters. Does their hard work deserve this constant ridicule?

> The only way to improve PHP is to replace it, and we have a long way to go to get there.

Agreed. When something better comes along, I'll start using it (like how I switched from Perl to PHP a long time ago). The problem is, many "eloquent, smart programmers" are too busy "posting long, well researched screeds" to spend some time making PHP better (or making a better PHP).

> Does their hard work deserve this constant ridicule?

Nobody seriously criticizing PHP is ridiculing people working with it. On the contrary, I personally applaud people having to, and succeeding at extracting diamonds with a broken pickaxe.

> The problem is, many "eloquent, smart programmers" are too busy "posting long, well researched screeds" to spend some time making PHP better (or making a better PHP).

A "better" PHP would be at its core so entirely different and incompatible with the current PHP that calling it "PHP" would be a complete misnomer. Since it would be such a different language/platform with only vague syntactic and semantic similarities, one might as well invest its time in the better designed, actively developed, battle-tested, currently available alternatives.

> Nobody seriously criticizing PHP is ridiculing people working with it.

I rarely see this. I've found it hard to find a good criticism of PHP that doesn't find a way to insult it's user base.

Probably the best criticism of PHP has come from Jeff Atwood's recent post[1] (and even he couldn't go the post without slinging immature, and downright vulgar insults).

1. http://www.codinghorror.com/blog/2012/06/the-php-singularity...

That's exactly what I'm talking about, it's insulting and it disappoints me that all of the recent HN threads have been full of similar insults. Their arguments always seem to boil down to "my hammer is better than your hammer, and you're an idiot for choosing the wrong hammer, but luckily I am here to re-educate you".
It seems to me that the kicker is the obviously superior alternatives, such as python, ruby, and JavaScript, don't offer the ease of deployment that php has via mod_php, and instead insist on the developer writing a web server. While there are advantages (performance, control) to the web server approach it is clear that there are advantages (simplicty) to being able to stick code snippets in web pages.

If you could deploy (say) python-decorated web pages via apache (on el cheapo hosting services) versus write yor own server and figure out how to host it then the problem would be solved. We have the languages, just not the ecosystems.

Obviously I'm not the first to observe this. Mod_python exists, it's just not popular.

You are wrong to say that these 'insist on the developer writing a web server.' All you have to do is choose a web server, which was also true with PHP (even if all you want to do is choose Apache).

Some of these servers are so easy to install and use, so much EASIER than Apache, that it really gets ridiculous to complain about.

mod_python has been deprecated for years in favor of mod_wsgi, which uses an actual standard. That you don't know this shows that the problem is too much documentation guiding people to things which are no longer modern or standard. If you use Apache, use mod_wsgi, it is infinitely better.

webfaction costs $5.50/mo, lets you do proper Python deploys rather than endless hacks and has good support, if you need cheap Python hosting.

I don't know any rails developer who has written a web server, where did you get that idea? Many use mod_rails via nginx or apache:

http://www.modrails.com/

Also, PAAS offerings like Heroku and Engine Yard make deploying sophisticated rails environments far more convenient than their PHP equivalent.

> "sticking code snippets in web pages"

You can do exactly this in ruby with ERB, but many shy away from this approach due to a distaste for the bolognaise pattern.

You should try ruby/rails/sinatra on your next project, it will change your life.

I've tried rails, years ago. Don't like its fundamental design. My life remains unchanged.

BTW how do you think rails serves web pages?

> If you could deploy (say) python-decorated web pages via apache

This is a terrible, terrible idea. There are a few Python frameworks which have tried similar things, but Model-View-Controller was invented for a reason.

PHP can not be improved. An "improved PHP" would be completely different language, and probably a rewrite of the codebase. The difference between "improved PHP" and PHP as it stands today would at least as great as the difference between Perl and Perl6.

And if you are going to design a new language (that's what "improved PHP" would be), you have very little to gain in basing your work on PHP. The ecosystem is in the current PHP, and it is as likely to transition to completely different language as it would be to transition to your "improved PHP".

I think the people that attack it would rather see it die off than be "improved".
I don't think those people understand the economics of programming languages. It's not going to die off any time soon, what with all the thousands of companies that use it, and zillions of lines of code.

As someone who would rather not ever work with PHP again, the best thing is to simply focus on other languages and environments, helping to bolster those ecosystems.

Agreed, but publicising stupid problems with PHP actually does help that cause - it might push someone who's "on the fence" over to using a better system.
I'm one of those on the fence. I've spent most of my programming life working on PHP and the recent barrage of negativity against PHP has made me more interested in learning another language, if just to make an educated comparison and see whether I am continue to use PHP "because I know it" or because it is actually good.

I'm currently having a go at Python + Flask in my spare time.

Recent? I never cared for it, and I know that was a common sentiment amongst many 'HN' type people (even though there was no HN then), but until Ruby on Rails came out, I had never found something that had everything I needed and wide appeal. At the time, for me, that meant continued work on Apache Rivet ( http://tcl.apache.org/rivet/ ) , which in a lot of ways was better than PHP, but always suffered from not having a lot of users.
To clarify, "die off" means "stop getting NEW projects," not "everyone spontaneously destroys existing legacy apps." That has never been on the table.

When you say you don't want to use PHP again and want to focus on other languages, you are saying you want PHP to die off.

I'm certainly no fan of PHP, you're correct, but people will continue to do new things in it for many years to come, because that's what they know.
I stopped using PHP years ago because their open-source community is a broken insider network. After wasting a few bug reports repeatedly arguing with certain core developers who took the position that code and documentation not being in sync wasn't a bug, I quit trying.
I'd rather spend my time making good languages better than making awful languages ever so slightly less awful.