Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I loved the original post about PHP's fractal awfulness, but this sums up my feelings about it: I like it anyway. His point about PHP being shared-nothing by default is a good one: this is indeed a big part of the admirable scalability of web apps written in PHP (Facebook, anyone?).

The one point I'd disagree with is his assertion that PHP doesn't have a templating language. Of course it doesn't: PHP is a templating language. That's what it was written to be. Many of the uglier things you have to do in PHP are related to the fact that what the language always wants to do, by default, is spit out a web page.

If what you want to do with your software is output web pages, then PHP is the best call. If you want to do basically anything else, pick another language. But at web applications, PHP just can't be beat.



I'm glad you like it, but the "shared-nothing" line is outrageous bunk. Commonly repeated bunk, so I don't blame you, but it's still bunk.

Pretty much every PHP app in the world shares a database. So you've shifted your scaling problems from an area that programmers understand and control to a 1-MLOC mystery.

I bring this up because I have a few friends who make their living saving the asses of PHP programmers who buy the notion that PHP is magically easy to scale. I hear a lot of horror stories from them about the absurd sums of money spent cleaning up the messes.

I do agree that PHP is fine for doing basic web apps. But I don't know anybody doing anything serious with PHP that only uses PHP, because serious web apps eventually need more than you can do in that language. PHP's "shared-nothing" scaling just means that when the going gets tough, some language other than PHP will be doing the work.


> Pretty much every PHP app in the world shares a database. So you've shifted your scaling problems from an area that programmers understand and control to a 1-MLOC mystery.

True, however in my experience it's pretty easy to scale the database layer. One beefy DB server can easily handle 2 or 3 front end servers with even mild caching. If you get aggressive in the caching strategy, one DB server can handle up to 10 front end boxes. And if you need to scale beyond that, replication is a well understood paradigm (sure, not by normal app developers, but there's plenty of resources out there).

> I bring this up because I have a few friends who make their living saving the asses of PHP programmers who buy the notion that PHP is magically easy to scale.

I never said that it was magically able to scale. I said that the language is easy to scale. What you do with it is on you. So if you're writing garbage code, you're going to get garbage scalability...


Not quite sure why you're jumping in to this sub-thread. I'm just taking issue with the "shared nothing" line that people hand out.

Note, though, that you've introduced another shared resource, cache servers, to fix the problems that a "shared nothing" approach introduces. Because once again, the "shared nothing" line is bunk.


You're right that the back-end often gets ported to some other language when a PHP app is scaled-up; this goes with my point that when you move away from spitting out web pages, another language is a better choice.

I'm not sure your point about a database is valid; Python and Ruby and Perl apps are all using a shared database (or newer k-v store) as well.


My point is that it's the place where all shared state is kept. "Shared nothing" is a lie because it's sweeping the sharing under the rug of the database.

I agree that most web stuff written in scripting languages is built around a database for shared state. But in more powerful languages, you have other options.


Never claimed Python/Ruby solve this problem, just that PHP doesn't (but is claimed to).




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: