Live data from Hacker News

Why so much hate for PHP?

news.ycombinator.com

41–50 of 74 posts

Re: Why so much hate for PHP?

#41
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…

> We've reached the turning point where you hear far more about big companies moving from rails, than switching to it.

A lot of this is because 1) they jumped on the rails bandwagon without understanding it or if it suited their needs 2) after using rails to prototype their site, they now understand what their architecture should look like and want to start fresh 3) because they've joined the next circle jerk such ask nodejs

All the rest of your post is overly vague, or simply untrue. People pick rails because it has sane defaults eg. ActiveRecord but there are plenty of other gems for other database persistence layers.

Re: Why so much hate for PHP?

#42
post #34

Earlier quoted context omitted.

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 em…

What you're overlooking here is the "model" part of an MVC application is not limited to being an Active Record object. Indeed, many experienced Rails developers are also major proponents of the use of service objects and "domain models" which can exist outside of the database.

The misunderstanding of when an MVC architecture is appropriate, and when to (and not to) use the framework, is the mark of someone who has not yet really understood how to use Rails effectively.

Re: Why so much hate for PHP?

#44
post #14
post #11

Earlier quoted context omitted.

Care to point folks to an example of a more modern PHP script that shows off improvements since the state of things in 2005?

http://laravel.com/

Laravel is a great framework and has really helped push the community towards writing tests and producing packages that can be easily shared via composer. Of course Symfony has a big part to play in Laravel's success to.

2013 was a good year for PHP. Most of the time when I hear people complaining about the language, it's as if things haven't changed since 2005.

There's a lot of horrible, badly written spaghetti code out there in PHP that doesn't exist in other languages, but there's also probably much more decent code written in PHP and I think that trend is only set to continue.

Re: Why so much hate for PHP?

#45
post #24

There are a number of reasons why PHP is so disliked by outside communities including but not limited to MAGZine's points. 1) As mentioned there are a number of language inconsistencies, much more so than comparable languages. This includes naming schemes for functions 2) PHP and most major projects written in it are insecure. Even up-to-date Wordpress installs are vulnerable to attacks. 3) Testing still isn't in vog…

Number 3 is the reason we moved our last PHP "backend" to Java ages ago (2006). I'm surprised it's the first mention I've seen of it here.

Re: Why so much hate for PHP?

#46
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…

This really has been one of the cancers at the heart of PHP development. Most of the reasons people give for hating the language amount to semantic issues which make it different than the language they'd prefer it to be, or syntax which, while annoying, can be dealt with, or edge cases no one is ever likely to encounter in actual practice (although I just recently saw an example of someone's PHP where they were including php files using shell_exec so the rabbithole of 'actual practice' can get pretty deep.)

The way SQL is implemented and executed still primarily is one of the primary arguments against, at the very least, not learning PHP properly. And it's definitely a point in the column of any framework in any language which can say that SQL injection and remote code execution are impossible in frameworks written in that language.

Re: Why so much hate for PHP?

#47
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…

> I really wish we could admit publicly that Ruby is really not a race horse.

Ruby isn't a race horse.

It just turns out that when you're just plowing fields, harnessing up your prize stallion is a waste of resources.

Re: Why so much hate for PHP?

#48
Here is why.

I like to equate the technical community with the skiing community. The barriers to entry are tough. It takes a lot of practice to become good skier, and many that do become expert skiers instantly elevate themselves above the rest with routes, equipment, and other types of "I'm more technical than you."

So, back to hate for PHP.

The C++ and Clojure and Erlang crowd are the double black diamond skiers, and they are the first to throw hate at the green and blue skiing crowd - because, well, they've mastered everything else and since they mastered it, well, they are just better than you.

Meanwhile, you've got the PHP type skiers who are cruising the groomers, enjoying the sun and living life - pinching themselves because they are just getting the task done. They occasionally hit a black or two, and even hit the moguls to refine their turns and technique, but they are there to get shit done - which means to ski and have fun.

Then you've got the Perl and COBOL guys who just ski around the mountain and complain about all of the above, since they've been skiing for 40+ years.

Disclaimer: I am an avid skier and maintain a number of successful Web properties based on PHP. And I love the groomers...

Re: Why so much hate for PHP?

#49
PHP is the lowest common denominator.

PHP is the ghetto. It might be fun or necessary when you're young and can't afford better. But, eventually people who are able, move somewhere they aren't being mentally stabbed in the face every time they pop down to the corner store. This, of course, reinforces the ghetto. As the people who can't leave are the dregs.

Nothing is as black and white as a couple sentences makes it sound. But, that is the place PHP has (deserved or no) in the programming world.

Re: Why so much hate for PHP?

#50
post #14

Earlier quoted context omitted.

http://laravel.com/

Laravel is a great framework and has really helped push the community towards writing tests and producing packages that can be easily shared via composer. Of course Symfony has a big part to play in Laravel's success to. 2013 was a good year for PHP. Most of the time when I hear people complaining about the language, it's as if things haven't changed since 2005. There's a lot of horrible, badly written spaghetti code…

The only thing I think I don't like about Laravel is that it doesn't use Twig as the default template engine.
Post reply on HN