Hacker News new | ask | show | jobs
by samdk 5095 days ago
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.

1 comments

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".
PHP is so incredibly bad as to have no redeeming qualities to the language whatsoever other than its simplicity in deployment.

Whereas I can have reasoned conversations with proponents of most modern languages, PHP is simply and unequivocally a complete and total failure of a language, and there is resultantly absolutely no room for concession when discussing the language.

PHP is broken and should never be used, and if there are use cases that the alternatives don't address, we should work to address them.

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.