Unable to load image

I Don’t Enjoy Writing PHP Anymore :!marseysoycry:

https://medium.com/@davert/why-i-dont-enjoy-writing-php-anymore-aee8a85ca8aa

Why I Don’t Enjoy Writing PHP Anymore | by Michael Bodnarchuk @davert | Oct, 2022 | Medium

It was my first web-development language and the first programming language I was paid for. And I know some shit about maintaining PHP libraries. PHP development nowadays is bumping versions, updating types, and tests, and getting out of cross-dependencies conflicts.

Let’s imagine this situation

I have my own library MyLib that is expected to support PHP 7.4 and PHP 8+ at the same time. As MyLib author I can either drop 🤠 Client #1 and make a major release not because I introduced some breaking changes but because I bumped dependency of coollib.

Now imagine what happens if coollib has also dependencies… And so on…

However, PHP engine treats them differently.

So here are two fundamental problems we have in modern PHP

If either of these won’t be a problem, we would not get into dependency heck. Problem #1 was solved in In #NodeJS. So in NodeJS context, different versions of the same library with different signatures of methods can live together. Using types in the ecosystem and getting into dependency conflict was not an expected outcome of introducing more and more incompatible types into the engine.

Libraries tend to add more and more type changes with breaking compatibility in interfaces every year. Anyway, we can’t force maintainers to keep on old interfaces, right?.

So let’s sum up

While PHP still keeps ugly array_* str* functions from 90s, it breaks compatibility in the ecosystem with every new release. So you get stuck with the lowest PHP version of any of your dependencies. So let’s get back to me, a library author who has a library that just works. 🤓 Client #2 upgraded their app and wants me to upgrade my code as well.

🤠 Client #1 could not get an upgrade yet and wants to use MyLib. Actually, that enterprise client may be supporting MyLib with donations or paying me for consultancy. As an author of a general-purpose library, I will need to maintain a library with versions for all currently used PHPs. But we can’t pay them for a month just to make your shitty MyLib be installed on our application.

It happens because the PHP engine does not keep the compatibility of interfaces between releases, because PHP libraries upgrade to the most modern features, and because we share the global namespace of loaded classes. As a library maintainer, I need to balance upgrades, create bridges between different libraries and always test for compatibility with other dependencies.

27
Jump in the discussion.

No email address required.

We need to rewrite PHP in Rust

Jump in the discussion.

No email address required.

:#marseyagreefast:

Jump in the discussion.

No email address required.

only if we rewrite Rust in Lisp

Jump in the discussion.

No email address required.

Darn you have to deal with cowtools like any other language instead of just blasting out .phps full of SQL injection holes. You have to do a build instead of just sshing in and changing shit on the fly. I sympathize though, all that bullshit was way more fun

Jump in the discussion.

No email address required.

He enjoyed php before?

Jump in the discussion.

No email address required.

he means PCP

Jump in the discussion.

No email address required.

Wtf is Client #1 and Client #2??? Isn't that you? Can't you decide which PHP you want to use? I'm not sure what PHP is.

Jump in the discussion.

No email address required.

PHP is short for cannibalism. The clients are the people he is planning to eat

Jump in the discussion.

No email address required.

Web devs are losers


https://i.postimg.cc/dVgyQgj2/image.png https://i.postimg.cc/d3Whbf0T/image.png

Jump in the discussion.

No email address required.

all the good ones went to the next level.

Jump in the discussion.

No email address required.

If you get to the point where you're writing libraries and you're still using PHP, I have no choice but to assume you're r-slurred

Jump in the discussion.

No email address required.

Everyone with some sense of sanity moved on from php decades ago. Most web development nowadays is done in far less frustrating languages that unless you're a :marseybrainletclapping: or a masochist, there's really no reason to continue using php.

Jump in the discussion.

No email address required.

Anyone who has ever "enjoyed" PHP is unironically r-slurred. :marseyemojirofl:

Jump in the discussion.

No email address required.

What that @FearOfBees not codecel

Trans lives matter

:#trumpjaktalking:

Jump in the discussion.

No email address required.

:#marseyrs:

Snapshots:

Jump in the discussion.

No email address required.

Link copied to clipboard
Action successful!
Error, please refresh the page and try again.