Hacker News new | ask | show | jobs
by skinnyarms 1679 days ago
If you like PHP, great.

Do you plan on creating a start-up that you intend to scale to a babillion customers? That you intend to hire teams of developers for? Probably not a good idea.

Are you a new programmer trying to figure out which language to learn first? Absolutely not. Python, Java, JavaScript, C# are much more flexible if nothing else. Anybody who tries to convince new programmers to learn PHP is doing them a great disservice.

3 comments

> Do you plan on creating a start-up that you intend to scale to a babillion customers?

Not interested in PHP in the slightest, but how is this myth still going around?

Wikipedia, Pornhub, Facebook (initially at least) were all built on PHP. There are hundreds of other examples.

Laravel nowadays has an outstanding reputation and I doubt it's performance is lagging so far behind Django for example.

More generally, after all these years I still need to see a story of a startup that failed because they chose the wrong stack. There are some blog posts with spurious claims in this sense, but really, when has a startup with good product-market fit and a finely designed product ever failed because they chose PHP instead of something else?

Those startups you mention are 15+ years old, would they still choose PHP today?

Maybe you haven't heard of startups failing because of choosing the wrong stack, but I'll wager you don't hear about most startups failing because...why would you? Also, have you heard of startups re-platforming? Either because the current stack is falling apart or the company is acquired by a bigger fish and they need to integrate with other services so parts end up getting rewritten to Java/C#.

The fact is PHP is good for making websites, and that's all you'd really want to do with it. There are other languages that are good at making websites and they are more popular and have other benefits.

If you are building things with PHP and it's working for you, then awesome. But seriously, why encourage it?

Except Facebook literally did that :)

But I agree with you.

Wikipedia too. And probably many WordPress websites with a lot of traffic.

If anything, PHP has proven it works in this regard.

Facebook and Wikipedia were both founded ~20 years ago, think they would make that same decision today?

PHP works, but imho starting a new company or career with PHP is a mistake.

I don't know, why not?

Why would it be a mistake?

On the one hand I have a few examples of huge, successful projects written in PHP and I know they are still around 20 years later and haven't been rewritten in another language. I use projects in PHP on a daily basis (Nextcloud, Rainloop, Wordpress) that work well and have been maintained for years. On the other hand I have a few comments calling out PHP without convincing arguments. Something is wrong.

I practice Python and Javascript daily, I've written PHP code 10 years ago, still use some of my code. I occasionally update PHP code on a website I manage. I've seen good things in the new versions.

Should I begin a new project today, I would not rule out PHP that fast. I like Python and Typescript, but PHP projects are often a breeze to install (unzip, done) and survive system upgrades and reboots easily as long as php-fpm runs. Projects in other languages need more babysitting. I know, I also use web software in other languages, including one I author.

PHP is dead simple to write too.

I would probably go for nodejs for something that requires Websockets or SSEs (or a compiled language). Otherwise, I'd seriously consider PHP because it does not require setting up something like uwsgi or celery, write reverse proxy rules, write init service files or running Docker. Put the files in www and it's done. Also no code for managing routes, the file system organization does this for me. No memory leaks, everything is thrown at the end of each request. The architecture is robust.

Couple reasons:

* It's waning in popularity, new programmers aren't being taught and there isn't a lot of incentive for them to seek it out * Other languages are also good at making websites but many are more popular and more flexible - machine learning, video games, front-end web development, enterprise services (and sure PHP can be "enterprise" but many new cloud/apache projects are java first)

So yeah, I'm not saying PHP is dead...just that it's not a good investment for new developers and it's questionable for new projects.

Also Slack, Etsy, Baidu (4th most visited site on the planet), Box, MailChimp, Spotify to name a few more that seem to be doing ok.
Yep, almost 20 years ago and it's been both a technical and hiring problem for them ever since.
Is there any large tech company without technical and hiring problems?
Why make it worse by choosing backend-only web languages with bad reputations?
> Anybody who tries to convince new programmers to learn PHP is doing them a great disservice.

It depends what location you're in. In Europe there are pockets where PHP is very popular, where learning it can open up the job market.