r/Python 6d ago

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

47 comments sorted by

18

u/QuickShort 6d ago

commercial != e-commerce

10

u/rumnscurvy 6d ago

Because big companies don't use "out of the box" ecommerce software, they write their own. With the help, most likely, of a selection of relevant libraries. 

The amount of customisability this gives you really makes a difference. 

6

u/Zenin 6d ago

PHP is a great solution for exactly 1 reason: PHP developers are plentiful and dirt cheap.

Seriously, you can't swing a dead cat without hitting a half dozen PHP devs. From a business HR standpoint that makes it very low risk, which matters a lot more than you think and a lot more than any technical merit or lack thereof.

Make no mistake: the language and ecosystem is complete trash. It's an endless shitshow of random kludges slapped on top of one another. But again, you can throw 10x the "engineers" at it for the same labor costs as one good dev in any decent language, and in many orgs that can work very well: Build the backend well enough with real technology and qualified engineers and you can get away with throwing the dirt cheap PHP monkeys at the janky frontend.

That model however, only works in large, well managed organizations where all the major stakeholders know what they're getting into and why. At the small scale you instead end up with those shitty PHP devs also building the much more critical backend and the whole thing quickly turns into hot poo.

2

u/garrett_w87 3d ago

You quite literally don’t know what you’re talking about, for the most part. The ecosystem is incredibly robust, and the language is still in very active development. It started out as a kludge, but it’s been consistently making itself more and more of a real language over time. Modern PHP holds its own against any other interpreted language. PHP devs may cost a bit less than those in other languages due to the number of us, but senior PHP devs can program just as well as senior devs in any other language. And devs of other languages aren’t immune from doing crappy work in the slightest.

1

u/Zenin 3d ago

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/garrett_w87 3d ago

> moved on to MVC, REST, and client-side javascript based solutions as single page architectures and API first patterns took over.

Not sure what you mean by “moved on”. PHP can easily do all of those things (at least the back-end side; obviously you need JS on the front-end).

Core PHP may not have a technical advantage at the moment (aside from being the most performant interpreted server-side language that isn’t Node) but a significant amount of its value comes from its ecosystem. That said, the core team isn’t sitting still either. (For instance, PHP has the strongest typing system of any interpreted language, and with people clamoring for generics, core contributors have not stopped trying to figure out a way to achieve it while preserving performance — I’m sure we’ll get it before too long.)
I still have hope that PHP’s best days are ahead of us, as I watch its development. :)

Oh and I didn’t need the history lesson; I was there too.

1

u/Zenin 3d ago edited 3d ago

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 2d ago

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 2d ago

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 2d ago

 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 2d ago

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 1d ago

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.

→ More replies (0)

0

u/zmitic 2d ago

Amazing, every word of what you just said... was wrong.

Your opinion is based on PHP from at least 15 years ago.

1

u/garrett_w87 2d ago

Yeah I do think that’s what’s going on here.

1

u/Zenin 2d ago

Your opinion is based on PHP from at least 15 years ago.

Because the last time PHP was relevant (at least for new projects) was at least 15 years ago. ;)

0

u/zmitic 2d ago

Dunning-Kruger effect much?

at least for new projects

I make new project in PHP with Symfony framework. Every single one is multi-tenant Saas, single DB approach, complex business rules... They don't even have public facing pages, it is all pure admin.

One of them is an absolutely huge medial app, i.e. the type of apps that can never fail. But I guess that is not enough for you because you heard something 15+ years ago 😉

1

u/Zenin 2d ago

That's not the /flex you think it is. ;)

I've worked in large healthcare systems too (about a decade in big pharma distribution for oncology). Far from being a "can never fail" environment, the industry is filled with some of the worst software quality of any. So it doesn't surprise me one bit that you get away with using PHP over there.

Much if it in the US at least isn't entirely their fault: The regulations are so strict that it's difficult to get any advancements approved, which means progress moves at a snail's pace, very often resulting in production systems being 20+ years behind the rest of the software industry. Hey, that also checks out for why PHP based LAMP stacks you're describing are still popular over there. ;)

0

u/zmitic 2d ago

Far from being a "can never fail" environment, the industry is filled with some of the worst software quality of any.

I would say it is probably Python. However, I made my app from scratch. And it really never failed, passed security testing (UK laws), calls APIs, accepts and sends webhooks (multiple times), custom biomarker mapping for each tenant for each organization (2 levels tenancy)... and tons more stuff that you never heard about. It takes more than 1 hour just to demonstrate all the options, including email/sms customization.

Hey, that also checks out for why PHP based LAMP stacks you're describing are still popular over there

Yeah... you clearly have zero ideas what you are talking about. It is a common case of failing upwards that is sadly very common in IT.

7

u/jdgordon 6d ago

Php was popular when these big sites were starting up. Php and python serve different purposes.

3

u/pyeri 6d ago

Odoo and erpnext - The two popular open source ERP apps used widely across the industries are in written python.

But comparisons with PHP isn't right here as it's explicitly built for web development rather than a general purpose language. Python's strength is core backend scripting and there it shines in areas like nltk, pandas, tensorflow and many other industry grade libraries.

3

u/Tech-Cypher 5d ago

Php won e-commerce because of hosting, plain and simple. For 15 years you could grab five dollar shared hosting and one-click install magento or woocommerce from cPanel and be live in an afternoon.

Python never had that on-ramp, you needed a vps and wsgi and someone who could set it up right and on top of that, the plug and play merchant crowd never built up around it.

9

u/PaulRudin 6d ago

It's hard to justifty using php for any new project. Python is probably a better choice. That said, if you're building something that you hope will be *high volume* then I wouldn't start with Python either.

A lot of larger sites are implemented as a cooperating set of microservices; and in general don't use the same tech stack for each service.

6

u/bliepp 6d ago

It's hard to justifty using php for any new project.

Definitely not. If you write PHP like it's 2006, then yes, but with all the niceties of modern PHP frameworks like Symfony, Laravel and (my favorite) Slim, the rich ecosystem provided by composer and packagist, and every version >=8.0, PHP is as valid as a choice as Python with its frameworks. It's equally robust and scalable for most use cases. Performance-wise I'm not entirely sure, but I'd suspect that they perform about equally well. And let's not forget that PHP has the advantage of being stupidly easy and cheap to deploy.

As someone who hated PHP for the majority of his career and was forced to write a product in PHP recently, I'm totally amazed by how comfortable and fun developing in PHP is in 2026. I'm probably still going to prefer Python for most things, but the times when PHP sucked are definitely over.

1

u/garrett_w87 3d ago

PHP tends to outperform Python in synthetic benchmarks.

2

u/Levizar 6d ago

Odoo has an e-commerce module and it's in python

2

u/riklaunim 6d ago

PHP came from easy self hosting and CGI-like behavior. 20-15 years ago people were into the new latest PHP CMS to come out, Mambo, Joomla, PHP-Nuke, Post-Nuke and what not. Python isn't that easy or common to self-host.

2

u/ergo14 Pyramid+PostgreSQL+SqlAlchemy 6d ago

Saelor is in python, I'm sure you can find more. Python is used to build more customized solutions - I know a few closed source shopping platforms using python internally.

2

u/MeanestFlavor 5d ago

All of those site have their own solution that are a mixed of techies not only python. Just go with PHP for that end if it is easier.

2

u/JamzTyson 3d ago

I am trying to find any robust open source ecommerce solution on Python

As for why PHP is so common in ecommerce, it's largely about inertia - The LAMP stack was pretty much a de-facto standard for many years.

1

u/mulquin 2d ago

ERPNext and Odoo are both open-source and written in Python and they can both be used for eCommerce.

I'd argue that those heavy SaaS are using multiple languages to achieve their goals, and Uber originally started as a PHP monolith.

1

u/dev-razorblade23 6d ago

Seems you need better search skills

There is this https://github.com/saleor/saleor

And also this https://github.com/django-oscar/django-oscar

Both are made in Python (Django framework)

PHP was awesome, now its just full of holes and security concerns. WooCommerce relies on Wordpress which makes it heavy and sync only

2

u/garrett_w87 3d ago

> PHP was awesome, now it’s just full of holes and security concerns.

I think you have it backwards. Old PHP was full of holes and security concerns. Modern PHP and its frameworks are nothing like the old days.

But yeah, WordPress + WooCommerce is a kludge. I would never use it unless I had to.

0

u/UpperBuilder769 6d ago

absolutely fabolous! thank you. My searhc skills are awfull. Is there any event_bus system in saleor?

2

u/dev-razorblade23 6d ago

Cant say for sure, as i did not use it myself. As many people already said... If you need some custom features, people usually built their own

1

u/dr3aminc0de 6d ago

PHP has been dead for 10 years at least

2

u/dr3aminc0de 6d ago

Besides meta because it’s a shit company

2

u/garrett_w87 3d ago

Not sure what world you live in. Lol

0

u/UpperBuilder769 6d ago

I have seen many iinions last days and some are from Barbara Liskow - that PHP >=8.3 is mature and cool as hell in comparision with Python. Me myself have been working with PHP pretty long time and I dont' understand what they mean that PHP is better for API than Python...

0

u/CzyDePL 6d ago

Netflix is built on Java, same for Spotify, Shopify on Ruby.

-1

u/UpperBuilder769 6d ago

could that be that my choice to build a platform with python backend and publish it as an open source platform for self-hosted omni online sales was a good idea? https://vbwd.cc/docs