Live data from Hacker News

Why so much hate for PHP?

news.ycombinator.com

31–40 of 74 posts

Re: Why so much hate for PHP?

#31

There are a lot of reasons already discussed, this one is especially famous: http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-de... PHP is not a exceptionally bad platform from a technical perspective, it usually gets the job done, is reliable, easy to operate and performant. But i guess the real reason why so many developers - including me - hate PHP is that plain PHP is pretty boring. It doesn't have opini…

The CodingHorror blog have been quite vocal on the tour too : http://www.codinghorror.com/blog/2012/06/the-php-singularity...

The problem with Jeff's writing isn't that he ever says one big thing that's just obviously wrong, but his pieces are full of bits that just sort of don't make sense.

Remember the immediate visceral reaction you had to the double-clawed hammer? That's exactly the reaction most sane programmers have to their first encounter with the web programming language PHP.

First of all, I didn't have a visceral reaction to that image (and I'm not sure Jeff knows what that word means), but setting that aside, the second sentiment is just wrong. PHP doesn't cause that reaction on your first encounter. Most of its ugliness is in a bunch of little things that you learn to deal with over time.

Another example. He says:

What we ought to be talking about is not how terrible PHP is – although its continued terribleness is a particularly damning indictment – but how we programmers can culturally displace a deeply flawed tool with a better one. How do we encourage new programmers to avoid picking up the double clawed hammer in favor of, well, a regular hammer?

And in the very next paragraph:

Despite the serious problems with PHP, I was forced to consider it. If you want to produce free-as-in-whatever code that runs on virtually every server in the world with zero friction or configuration hassles, PHP is damn near your only option.

I don't know how he doesn't think that contradicts his previous point. Actually, now I'm not even sure what his previous point was. Inexperienced programmers are wrong to choose PHP. But, also, PHP is the best choice available.

I won't go paragraph by paragraph, but these things really add up when reading his writing.

Re: Why so much hate for PHP?

#33

There are a lot of reasons already discussed, this one is especially famous: http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-de... PHP is not a exceptionally bad platform from a technical perspective, it usually gets the job done, is reliable, easy to operate and performant. But i guess the real reason why so many developers - including me - hate PHP is that plain PHP is pretty boring. It doesn't have opini…

Well, i like PHP but i see your point. To me, re-writing everything and introducing tests (PHPUnit: Ohhhhhh) is exciting.

Re: Why so much hate for PHP?

#34
post #6

Earlier quoted context omitted.

> Ruby is hilarious slow, for example. [citation needed]. Also, relevant Stack Overflow debate is available. [1] TL;DR: yes, of course Ruby is slower than, say, C, but today's bottleneck isn't hardware, it's developer productivity. (Developer time costs way more than hardware.) [1] https://stackoverflow.com/questions/2529852/why-do-people-sa...

Developer Productivity in Rails means having a self-righteous excuse for hard-coding vital, tunable elements of your app and pretending you didn't just do that. A rails app is constantly under "development" because so much of it is just plain hard-coded in place under the guise of MVC and its single model of persistence: Active Record. Down-vote all you want. We've reached the turning point where you hear far more ab…

I don't think there's enough attention on the fact that the strict MVC approach of big old school web frameworks like Rails is an increasingly glaring architectural dead-end. The "model" part of an MVC application is invariably far too complex to crowbar inside a couple of dozen Active Record subclasses. And you can't prescribe a one-size-fits-all architecture for the model from a framework level. That part has to emerge from the business and technical constraints of the specific application in order to be correct.

Re: Why so much hate for PHP?

#35
post #6

Earlier quoted context omitted.

> Ruby is hilarious slow, for example. [citation needed]. Also, relevant Stack Overflow debate is available. [1] TL;DR: yes, of course Ruby is slower than, say, C, but today's bottleneck isn't hardware, it's developer productivity. (Developer time costs way more than hardware.) [1] https://stackoverflow.com/questions/2529852/why-do-people-sa...

Depends on the task. Most of my programming is on the sysadmin side. So automation and log processing are two of the biggest things I deal with. I love Ruby to death. I'd program in it all the time if I could. And it works really well for automation. But for processing massive amounts of data? Not so much. I even did some tests a year or so ago when I was writing a script to merge together data from multiple log file…

As an aside, Perl's uniq is in List::MoreUtils [1].

[1] https://metacpan.org/pod/List::MoreUtils

Re: Why so much hate for PHP?

#36

TL;DR: Because we used it. Like many people, many years ago I learned php. It was easy to deploy, and make simple dynamic websites. Many hosting services provided support for it. I was quite happy to use it for these things. Then in 2008 I interned at Facebook. At the time, there had not yet been any attempts to improve the language by Facebook itself. Using php in an actual codebase - real world software - made me r…

I keep reading always the same things from people who simply don't know how to use it properly and feels hurted by a different-than-what-studied-at-school syntax.

different isn't always a virtue.

Re: Why so much hate for PHP?

#37
post #26
post #2

A quick dive into any PHP-related topic on HN should yield significant answers. Part of the hatred comes from the fact that the way people know PHP is from 2005, when it was essentially one really long procedural program. It's not so much that people ignore the recent upgrade in tooling/modern language constructs so much as people aren't familiar that they exist. However, these is still a lot of vitrol for PHP. Becau…

I'm surprised people aren't quicker to mention the fact that PHP was (and still is!) responsible for many simple SQL injection database dumps/hacks. A simple string termination was all it took. That I felt gave PHP a massively bad rap as they spent versions after that trying to figure out a way to prevent/deter it. Nowadays with wrappers it's thankfully less of a problem. Having just come off a Drupal project myself…

And anybody who learnt of their own accord probably had Google rapidly lead them to w3schools, and if they were really unlucky they might have noticed they have PHP tutorials. Their database query code used to use mysql_query with absolutely no protection, the basic sql injection disaster scenario. It now uses non-prepared mysqli_query, which a quick Google tells me still isn't safe. I'm sure everyone here knows it, but w3schools is seriously dangerous and seems like it will indefinitely damage the image of PHP.

Re: Why so much hate for PHP?

#38
post #8

I could write something here. But someone has already written a pretty comprehensive post on what's wrong with PHP. So I'm going to refer you to that. PHP a fractal of bad design: http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-de...

[deleted]

Re: Why so much hate for PHP?

#39

There are a lot of reasons already discussed, this one is especially famous: http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-de... PHP is not a exceptionally bad platform from a technical perspective, it usually gets the job done, is reliable, easy to operate and performant. But i guess the real reason why so many developers - including me - hate PHP is that plain PHP is pretty boring. It doesn't have opini…

This article is written in an "inflammatory" style, but it makes some hard- to- rebut points about PHP. If you're wondering why people hate PHP, like, really wondering, and not just trying to make yourself feel better about the language, try to get past the tone and read the technical content.

(If you're just trying to make yourself feel better about PHP, just remind yourself that Facebook is built in it, as are lots of other credible systems; languages are tools, and while better tools help, skill and discipline are more important).

Re: Why so much hate for PHP?

#40
post #6

Earlier quoted context omitted.

> Ruby is hilarious slow, for example. [citation needed]. Also, relevant Stack Overflow debate is available. [1] TL;DR: yes, of course Ruby is slower than, say, C, but today's bottleneck isn't hardware, it's developer productivity. (Developer time costs way more than hardware.) [1] https://stackoverflow.com/questions/2529852/why-do-people-sa...

Been a Ruby programmer for 5 years now and I find that this is dodging the issue. Sure the productivity is higher but what happens when you're finished developing and your code is now running in production? What happens when it's slow at serving requests, slow at any form of computations, slow when a rake task is starting? Talking about productivity is a good thing because raw "power" doesn't mean anything, but I rea…

There have been some steps in that direction, it seems. At my company, we made a graphics rendering engine in Ruby (haven't released it yet). In testing, it ran steadily, but consumed a lot of resources. But in each new version of Ruby, we saw that resource usage go down. Given that same level of innovation, we will see this graphics engine reach similar speeds as our current, more performant C and Lua implementation eventually.

Ruby 2.0 and 2.1 made incredible improvements to the garbage collector, a major source of our problem. We determined that it was the speed at which we were creating and destroying objects that was causing the GC to work on overdrive, which drove up CPU usage. So with the new GC improvements, we saw that usage go further and further down.

Post reply on HN