this post was submitted on 30 Oct 2023
989 points (96.1% liked)

Programmer Humor

32343 readers
1273 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] thisfro@slrpnk.net 36 points 1 year ago (5 children)

I'm sure there are a lot of reasons why PHP is better than Python for the backend, but I created an app wirh Symfony 5 and then an app with Django 4.

Symfony is so weird compared to Django. With Django I can just sit down and get things done. Symfony always seems to have some quirks which are mostly due to PHP (and me not knowing how to program in PHP).

That said, PHP hosting is so much easier and cheaper, this probably is important for smaller projects.

[–] Anticorp@lemmy.ml 12 points 1 year ago (3 children)

You don't need a framework for PHP. That's the beauty of it, you don't need anything. You cannot build a website with Python without a framework.

[–] _stranger_@lemmy.world 16 points 1 year ago

I know this answer is flippant and dickish, but:

python3 -m http.server 80
[–] thisfro@slrpnk.net 5 points 1 year ago

You don't need a framework for either, but it makes working with both much easier!

[–] camelbeard@lemmy.world 2 points 1 year ago (1 children)

Sure but don't cry when someone injects some js in your website or drops a table, because you didn't sanitize every input completely.

[–] PlexSheep@feddit.de 10 points 1 year ago

Django is pretty nice, yeah. We also have good compiled webapps, with go and rust. Gitea for example uses go.

[–] locuester@lemmy.zip 4 points 1 year ago (2 children)

Isn’t all hosting containerized at this point? Is hosted, language specific servers still a thing?

I’ve been out of the market for a while now and just run everything as containers on aws and gcp

[–] Anticorp@lemmy.ml 13 points 1 year ago

Isn’t all hosting containerized at this point?

No. Not even close.

[–] thisfro@slrpnk.net 1 points 1 year ago (1 children)

Many older projects don't get migrated to containerized infrastructure and smaller businesses don't want the overhead it creates to run a single app/webpage. Plain LAMP with FTP access is still the most common way to host I think (and thus the cheapest if you consider the amount of work that would need to be invested to containerize).

[–] locuester@lemmy.zip 1 points 1 year ago (1 children)

Interesting. I never really realized how it was more my path changing than the entire industry.

[–] thisfro@slrpnk.net 2 points 1 year ago

The industry is surely changing, but "the industry" is mostly geared towards enterprise, because it's where the money is. But the large amount of webpages are not enterprise pages but personal blogs, small businesses etc.

[–] TCB13@lemmy.world -3 points 1 year ago (1 children)

Lets just say that Python was a language that was never supposed to be used for anything production related. PHP's memory management and multi threading capabilities are WAY more solid and less prone to leaks than Python 's.

[–] kroy@lemmy.world 3 points 1 year ago (1 children)

As someone that used PHP professionally for literal decades, the PHP hate is so meme-y.

Its biggest problem is that it allows you to do some truly cursed things. The same can be said about other languages, but PHP really doesn't do much to set you up for success, especially as a new-intermediate coder.

With opcache, it became fast enough for basically most web backends, and as a language overall it does seem to be evolving and shedding off some of the crap that used to make it truly horrible in the hands of a new person. At least the type-juggling stupiderrors

Now I mainly use go and python (only because I have to on this one), and I would put Python and PHP on a similar level of "fuck this language" moments

[–] lightnegative@lemmy.world 2 points 1 year ago

cries in variable variables