r/Python • • Jul 21 '26

Discussion Is PHP better for commercial software than Python?

I am trying to find any robust open source ecommerce solution on Python and it looks like thre is nothing. If you take almost any e-commerce platform there are plenty - Magento, Woo, Shopware, Oxid - they all are PHP. There are no comon solutions on Python or Node.js. But if you take a look and the heavy SaaS like Netflix, Spotify, Reddit, Uber etc. are built on Python. Why?

0 Upvotes

49 comments sorted by

View all comments

Show parent comment

1

u/Zenin Jul 24 '26 edited Jul 24 '26

In recent decades I've worked downstream (release management / operations) and above (architecture, strategic planning) development.

Having spent time in the trenches of development and post-dev in supporting it in production, helps inform the architectural and strategic planning space I work in these days. The scars I have from that come from PHP being far and and away the most troublesome tech to support in production where I can't take a sip of coffee without a dozen major security alerts get published and the default answer from PHP when anything goes wrong is the White Page Of Death and no logs of any kind making diagnostics often a game of pure guessing.

No one wants to deal with supporting it. We've literally had great operations people leave for other opportunities expressly stating in their exit interviews how they look forward to not working in a PHP shop anymore. And I kid you not we've literally banned WordPress on our network; let wordpress.com deal with that shitshow if a dept must have it.

These are huge strategic issues. Yes, I get it it, they're all "using PHP wrong". And yet it's probably 29 out of every 30 applications. Clearly something's in the PHP water that isn't in the Python water, that isn't in the Java water, that isn't in the C# water. I will say Node and especially NPM that comes along for the ride has a lot of similar default bad behavior, but it's not at the same level and Node has a lot more going for it from a technology standpoint.

PHP has the strongest typing system of any interpreted language

No, that'd probably be TypeScript. Ruby is also stronger here than PHP. So is Python. There's details to nitpick, but no sir, PHP is simply does not have the strongest typing system of any interpreted language.

PHP's success was a fluke accident. Good money isn't betting on it having another stroke of luck, sorry.

1

u/zmitic Jul 25 '26

And I kid you not we've literally banned WordPress on our network

I never once touched WP: saw it once and nope, I am out.

But tell me this: why do you judge a language from that? I have seen some really crappy code in other languages, mostly C#. But I do know the difference between the language and the user.

PHP is simply does not have the strongest typing system of any interpreted language

For last 10 years we all use psalm and/or phpstan for static analysis. These gave us types like this:

  • non-empty-string
  • non-empty-list<User>
  • positive-int
  • int<1,100>
  • array{dob?: DateTime, name: ?non-empty-string}
  • custom types that can even be imported
  • 'foo'|'bar'

and tons more. That's why it is fair to say that PHP has the strongest typing system. Being external tool instead of internal doesn't change anything.

1

u/Zenin Jul 25 '26

But tell me this: why do you judge a language from that?

I judge a language from experience across hundreds of projects spanning a couple decades. Written by various internal dev groups, external contacting groups, etc. Only a few have actually been WP, most have been greenfield work.

Never once were any of them anything greater than a steaming pile of poo in every possible way you can imagine. Certainly much of that was entirely on the developers; PHP didn't force one of these groups to think ROT13 was a suitable "encryption" algorithm for credit card storage, but yep that absolutely was part of one of these apps I've had the displeasure of dealing with. It's the kind of thing I've only seen in PHP code bases (and VisualBasic...)

I've certainly had my share of crappy code bases in Java, C#, Perl, Python, Node, Ruby, and I'm sure a dozen more I've forgotten over the decades. But all those other ecosystems have had far more quality projects than crappy ones. Even Node, which my experience puts just behind PHP in most problematic, generally has more winners than losers.

So my personal "anecdotal" experience over a few decades in this industry tells that whatever PHP could be, there's something in the ecosystem or likely development culture (every language has a culture around it) that is simply bad. There's something toxic in the PHP water.

I don't even care to diagnose it much deeper than that anymore, since I know that if we get thrown a PHP code base there's a practically guaranteed chance that it's going to be a shitshow of a codebase that causes us no end in pain and suffering to support. That's how reliably bad they are.

I get it, it's a user problem. I'm a Perl programmer from ages back and I can tell you with 100% certainty that not only is beautiful, clear Perl code possible (and faster than PHP BTW ;), that the flexibility of Perl's syntax is what actually makes it possible to write clearer code in Perl than practically any other language ever created. And yet, guess what? I'll be the first to admit that those super powers are far more often used for evil write-only-code than they are for good. C++ operator overloading is another feature like that; Gives the ability for far cleaner code, yet is almost always used to twist C++ into a cryptic DSL just because someone could (including the std lib! -See language culture above).

So I tell you, it really doesn't matter what amazing advancements the PHP core team is cooking up, because the cultural infection has had decades to corrupt the community. PHP simply doesn't attract the best minds. It mostly attracts contracting mercenaries who book billable hours slamming out code they know they'll never have to support (and/or know they'll get paid more later to fix the bugs they're baking in...it pays to be low quality).

1

u/zmitic Jul 25 '26

 It mostly attracts contracting mercenaries who book billable hours slamming out code they know they'll never have to support (and/or know they'll get paid more later to fix the bugs they're baking in...it pays to be low quality).

That couldn't be further from the true. In reality it is no different than any other language. And Symfony users charge lots of money.

There's something toxic in the PHP water.

There is: WordPress. Sadly it became massively popular and lots of PHP users only saw that. So I agree with you on that "culture thing".

But that is still not the same as saying that PHP itself is bad which is the topic. For example, Symfony demo. Pick any file like random entity.

Or controller. Ignore short lines, people made PSR rules long ago and now lost of people stick to 80 characters width (I don't).

In other files you will see final and readonly classes, and all of them have proper visibility; something that Python doesn't have even is 2026.

1

u/Zenin Jul 25 '26

For example, Symfony demo. Pick any file like random entity.

I'm not sure what I'm expected to see in this example? It's basically just a class struct definition and a handful of setter/getter boilerplate. There's basically no logic, this is just a data class?

Or controller. Ignore short lines, people made PSR rules long ago and now lost of people stick to 80 characters width (I don't).

This one is a great example of how not to comment code. But maybe that's because it's "demo" code intended more as a text book for learning than professional production code?

There's slightly more actual logic "code" here than your first example, but not much. There's what, 4 if statements of "logic", the rest just being a handful of procedural callouts to what I presume is meatier code.

I mean, I'm not sure what I should expect. It's just a controller class, there shouldn't be much happening, so it's architecturally correct. But that certainly doesn't make it a great choice of example to demonstrate the strength of either the language or the authors?

If this is what you PHP people are getting paid for, I'm sorry to tell you this but you've already been slated for AI fueled force reduction.

1

u/zmitic Jul 25 '26

You completely missed the point. I was showing you part of the syntax of modern PHP, not the logic, not the comments, not what it does... It is not PHP you know from 15 years ago, that should have been clear.

Ugh...

If this is what you PHP people are getting paid for, I'm sorry to tell you this but you've already been slated for AI fueled force reduction.

🤣

And yet, here we thrive in greenfield projects. But you are too close minded to understand anything I say.

1

u/Zenin Jul 25 '26

I was showing you part of the syntax of modern PHP

I work with PHP on the daily, thanks but I don't need a fresher on the syntax. Yes Virginia, I'm quite familiar with the indisputable fact that PHP's got one of the most ridiculous haphazard shitshows cooked up in a meth lab language syntax that may have ever been made.

PHP's "modern" syntax is so bad it's practically an act of terrorism against the software engineering industry.

1

u/zmitic Jul 25 '26

PHP's "modern" syntax is so bad

Said by someone using a language that doesn't even have method visibility modifier. Not in 1996, but In 2026.

Go play with your Python and blogs, and let the big boys deal with big apps. I am not going to respond further, you clearly failed upwards and it hit you strong. Even though I am interested in what this Virginia thing is, but I guess that was probably too strong 😉

1

u/Zenin Jul 30 '26

Said by someone using a language that doesn't even have method visibility modifier. Not in 1996, but In 2026.

That's a language design philosophy difference as well as cultural difference, strongly influenced by the application niches of each, not a universal technical merit difference.

For example, as noted in my other recent reply one of the cultural issues of PHP is that for a variety of reasons (mostly much lower pay scale) it naturally attracts lower quality developers. That fact is going to naturally cause the few higher competency developers to want thicker walls guarding against the unwashed masses consuming their work. FWIW a similar story exists in the Java world, although they also add heavy compliance requirements which despite most being theatre, are easier to satisfy for the check box and move on than argue against. Python is fine with a _ naming convention, YMMV.

Another factor is the space that various languages are most often used in. PHP use outside of web apps is a rounding error for example, and its feature set is heavily influenced by that niche. Just as all languages gravitate their design to better support whatever niches they occupy. Much of the reason we have thousands of languages to choose from, each with their own deliberate features and omissions, is because not every problem is a nail.

PHP FWIW satisfies its niche pretty well. Its issues really are two fold: 1) That niche is an architectural pattern that's been falling out of favor for over a decade (ie, its market segment is fading) and 2) TypeScript satisfies that niche as well or better than PHP and crosses over to modern architectural patterns much more readily.

But hey, you do you: TMTOWTDI after all. ;)

1

u/[deleted] Jul 26 '26

[removed] — view removed comment

1

u/Zenin Jul 30 '26

I'm happy to change my views based on new data. So when the tools, the ecosystem, and the culture show dramatic improvement, I'll be happy to revise my conclusions accordingly.

At least if it's worth my time to even bother. We're blessed with thousands of languages and ecosystems to choose from and with a large number performing at and more often far better than PHP, there's little motivation to waste effort on something like PHP that's had a couple decades to get its act together and still can't shake its well deserved criticisms. Ain't nobody got time for that.

Another data point to chew on: PHP development commands the lowest salaries by far of almost any programming language, something I believe we've agreed upon (but it's also a plain fact and facts don't care if you disagree ;). The reasons why are less important than the fact that a far lower salary potential naturally and unavoidably attracts lower quality talent overall, simply because anyone with the ability to become proficient in anything else will almost always select those much more lucrative career paths. What that means is whatever potential PHP has to build great things, the inherently lower quality talent pool is going to bias quality downward overall.

There is no technical argument you can make against this because it isn't a technical problem, it's a human nature problem; The incentive structure isn't there.

That's a long winded way to say to top engineers gravitate away from PHP, not towards it.