this post was submitted on 16 Jun 2023
76 points (100.0% liked)

Programming

13376 readers
1 users here now

All things programming and coding related. Subcommunity of Technology.


This community's icon was made by Aaron Schneider, under the CC-BY-NC-SA 4.0 license.

founded 1 year ago
MODERATORS
 

I don't know if it's due to over-exposure to programming memes but I certainly believed that no one was starting new PHP projects in 2023 (or 2020, or 2018, or 2012...). I was under the impression we only still discussed it at all because WordPress is still around.

Would a PHP evangelist like to disabuse me of my notions and make an argument for using PHP for projects such as Kbin in this day and age?

you are viewing a single comment's thread
view the rest of the comments
[–] rekkar@feddit.de 14 points 1 year ago (2 children)

Modern PHP is much better than most people expect. It has very little to do with the PHP4 we all grew up to dislike for its quirks and inconsistencies.

That said, I wish more software was done in PHP. And for me it makes a lot of sense regarding the Fediverse. A PHP platform I can put on my existing shared hosting and connect some (sub)domain to it and call it a day. Most smaller/meduim businesses probably have that hosting constellation already around, idling around most of the time. The entry barrier is just so much slower than spinning up a VPS or renting cloud space somewhere just to test a small instance of something. Sure it scales not as good as your average cloudplatform but for most usecases that is not the biggest concern.

Different product but I love Matomo as a Google Analytics because I can just copy the files to a clients shared hosting, connect a subdomain to it and if it uses Sqlite (also better than it's fame!), I am done already and don't need to create a database even.

[–] deedasmi@lemmy.timdn.com 4 points 1 year ago (2 children)

Massive PHP hater here!

Yeah, even outside the loop I know that, just like every other major programming language, it has grown a lot to mature with general coding practices. It's reasonable well suited for something that has tons of server side content.

[–] rekkar@feddit.de 2 points 1 year ago

Kudos for saying that even as a massive PHP hater :)

IMO there is a reason why Wordpress is so popular (Disclaimer: massive Wordpress hater here!). Because of ease of install, more people can upload some folder in an (Web)FTP client than spinning up a Docker Container somewhere to host the latest JS Framework of the day just to host their little page or to show their content.

There is simply no need for bundlers, preprocessors and often not even [a lot of] package management (I'm aware of PHP composer though)

And exactly that ease of install is what could IMO make the Fediverse more democratic than having to run a container at some VPS that only a comparetively few people are able to do.

[–] catacomb@beehaw.org 1 points 1 year ago

I went from PHP lover to PHP hater about a decade ago. I have to admit, reading some of the Kbin code has made me hate it a little less. It's nice not to see include() and require() everywhere. It's also nice to see some type safety features as that was the biggest reason I moved on. For anything much bigger than a simple script, even if you think you won't, you're going to struggle without it.

It's still not my first preference (and, let's face it, most of this is preference) but it looks a lot better.

[–] redcalcium@c.calciumlabs.com 1 points 1 year ago (1 children)

It's not an issue these days now that containerized deployments became mainstream. As long as your project provides a Dockerfile, nobody cares what language and framework you use as you can deploy a docker image almost everywhere these days. Both Lemmy and Kbin includes a Dockerfile out of the box.

[–] rekkar@feddit.de 1 points 1 year ago

You are right that there is a dockerfile for pretty much everything these days.

However, as an example, I am using Sabre as a CardDAV/CalDAV Server on one of my domains. There is simply no need to spin up an extra container for something simple like this. Same with Matomo for analytics in my comment above, you are just writing a better logfile essentially.

Now Kbin has much more functions than that and I would probably run that in a container as well. For smaller and leaner things, I see shared hosting still as the easier way. When you know that containers exist, you are already in an expert bubble. I would claim that many many people know how to use an FTP client from their Desktop than are able to host a container somewhere - not that I'm a fan of FTP but SCP is already more advanced for that said group I assume.