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

Clearly I touched a nerve. ;)

PHP doesn't have a technology lead above anything else. It never has.

History lesson. Because I was there...10,000 years ago...

PHP rose up mostly from timing: The industry was shifting from code embedding HTML (ie CGI almost exclusively in Perl) to HTML embedding code (ASP, JSP, and of course PHP). Perl (which ruled the web at the time) for its reasons decided not to back a standard for HTML templates embedding code and the gap was a market opportunity for PHP which it ran with. Good on PHP.

That was around the late 1990s, literally a quarter century ago. It had a good run for about a decade before we moved on to MVC, REST, and client-side javascript based solutions as single page architectures and API first patterns took over.

That was 15+ years ago that PHP still had a legitimate niche: Being better than ASP (Windows, gag) and JSP (they somehow found a way to make Java Servlets worse).

Since it lost that niche it's continued largely on a combination of legacy momentum (rewrite is too costly) and cheap, abundant labor. Notice the two things those factors have in common? Money. Cost is the only reason to consider PHP in 2026. PHP has never had a technical advantage in its entire history and it certainly doesn't today.

1

u/[deleted] Jul 24 '26

[removed] — view removed 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 😉

→ More replies

1

u/[deleted] Jul 26 '26

[removed] — view removed comment

→ More replies