Hacker News new | ask | show | jobs
by ewjordan 2864 days ago
If a company already has a large PHP codebase, then it's probably the right choice to stick with it. And it can scale just fine, easily as well as Python or Ruby if you dig into how to do it right.

But to manage scalable PHP (or any language, for that matter) you still need smart programmers, a lot of whom will have been through most of the serious academic works in the field. They won't love working with PHP (I never did), and it might mean greater flight risk (yup!), but they might join the job anyways (at least half a dozen people that I know with those creds that joined up with the last project I was on where we had no choice but to deal with PHP) because of other reasons, like liking the company, people, or goals.

I've worked with a dozen different languages over the last 20 years. PHP is not one that I'd pick for a new project, but TBH, it's not the worst I've had to deal with. My experiences with the Visual Basic, Perl, and R code that I've had to interact with were actually far worse (typically because the people that code them are not as solid in software engineering), but I wouldn't judge people that use them just based on having done so. Unless we're spinning up new prototypes, very few of us actually get to choose the technologies that we use.

2 comments

I've learned to avoid vb.net shops not because of the language per se, but because of the culture that allows for sticking with something that has widely considered legacy for some time now.

I know this is painting with a broad brush, and I'm working from a sample size of 2 (or, 2 vb.net shops that I've worked with), and the software engineering culture as a whole was really bad on those teams.

>>> And it can scale just fine, easily as well as Python or Ruby if you dig into how to do it right.

The webserver is scaled by just adding more instances in parallel with a load balancer. It's the database that needs to scale and that's the challenge.

Absolutely, though I'd warn that if you naively use PHP and a default setup (Apache with default settings for PHP or something like that), you're probably not going to serve as much traffic per server as a naive Python or Ruby setup will get you. You have to tune your way there, and it can be a bit of a process, but it's definitely possible, and there's nothing very subtle about it.

One of the biggest problems with PHP, IMO, is that most of the code you'll find online is extremely old, and probably will give you terrible advice, using old deprecated mysql libraries, etc.

And don't you have to reopen database connections for each php request? Even that seems fairly difficult to scale, unless there's a way around it that I'm not aware of (I don't use php very often, definitely not at scale).
Of course not. Connection pooling is the most basic feature of any database library. It would be really shocking if PHP didn't do that.