davert 🇺🇦 Profile picture
Oct 4 13 tweets 5 min read
I will take this out and write a thread on why I don't enjoy writing #PHP anymore.

PHP development nowadays is bumping versions, updating types, and tests. And getting out of cross-dependencies conflicts.

👇
Let's take this situation, I have my own library MyLib that is expected to support PHP 7.4 and 8+ in the same time.

Meanwhile the coollib package I depend on releases its v2 where it changes interface of the same function to incompatible one: Image
Client #2 already migrated PHP 8.1 and wants to install coollib 2.0 while

Client #1 is using PHP 7.4 and can't move to coollib 2.0

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 dep Image
Now imagine what happens if coollib has also dependencies... Getting out of confict is pain.

I don't understand why

doStuff(mixed $val)

and

doStuff($val)

are conflicting with each other as they are basically the same function! But they are different for PHP engine.
So here are two problems:

🎃 All PHP classes and functions are loaded globally.

🎃 New PHP types are not backwards compatible.

If either of this won't be a thing we would not get into dependency hell.
Problem #1 was solved in In #NodeJS.
If you require a module it will stay only in the current context and won't affect the whole application.

So in NodeJS context different versions of the same library with different method signatures can live together.
Problem #2 could be solved on engine level but probably it was not predicted from the start. You can never know how ecosystem reacts to new features.

Library embraced more and more type changes breaking compatibility in interfaces in every year

Banning types could be an option
So here we are!

While PHP still keeps ugly array_* str* functions from 90s, it breaks compatibility in the ecosystem with every new release.

So it's neither a modern language nor a stable one.

(sorry, #PHP,. you know I love you but I must have said this)
While you can think that everyone can do upgrades every year, it can be automated via @rectorphp and so on...

Well, you can't run Rector on all your dependencies and bump new versions without maintainer permission.

So you get stuck with PHP version of a dependency you don't own
@rectorphp That's how some big project are still on PHP 7.2..7.4 and can't get to PHP 8.1.

Upgrading has its cost.

While making a mid-sized framework-based project can be fine to upgrade, large enterprise codebases with custom core and dozen of dependencies are painfully hard to upgrade Image
So let's get back to me, a library author who has a library that just works.

Client #2 (mid-size) upgraded their app and wants me to upgrade my code as well

Client #1 (enterprise size) could not get an upgrade yet and wants to use MyLib

Should I drop enterprise client?
And as an author of general purpose library I will need to maintain a library with versions for all currently used PHPs. You see, that's sucks!

Otherwise:

I say: my lib is PHP 8.1 compatible!

Client says: ok, we are not going to use your lib, as we won't upgrade just to use it
I really appreciate all the work of all developers from @laravelphp and @symfony ecosystems as you make PHP modern and cool.

But I the dependency hell problem won't allow PHP projects to grow big yet keep up with all upgrades unless split into microservices.

/THREAD

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with davert 🇺🇦

davert 🇺🇦 Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @davert

Oct 3
As of recent tweets of @elonmusk

I think it's ok that if you build your decisions by the idea of "not being the like others" the same pattern repeats when it comes to other decisions.

If we think of world as a big, corporation, Elon, what corporate culture do you encourage?
@elonmusk If someone stals your assets - it's fine

If someone kills your employees - let's negotiate

If someone captures your factories - let's make workers to decide in which company they want to work in

If someone threatens you to destroy completely, just give them what they ask
@elonmusk can you show us an example and share your stocks with BMV / General Motors / etc

Looks like this is the best option for Tesla! Why should your workers suffer?
Read 4 tweets
Sep 13
Ok, let's try something different. Useful technical/business thread for #web #makers from me.

🔌 How to build @atlassian Jira App (in #React) and business around it and why you should actually think of it!

Thread: 🧵
@Atlassian 2/12 We started @testomatio (test management system for #qa) as a classical #SaaS app but at some point, we built a Jira plugin as a complimentary interface.

The feedback from clients surprised us. Some clients preferred to use @testomatio only via Jira plugin

Why? 👇
3/12 Jira is still the source of truth for many companies in the world. And if you want to win small & big you should adjust to business needs. And business works primarily on Jira.

One unobvious conclusion:

Business doesn't want to have another app or even leave Jira
Read 13 tweets
Sep 12
To promote this I will tell you how we rided 3 cars to East. I started my driving lessons only year ago, with no car experience in past. Last week I drove 130-150 km/h on a dirty road following the heading car.
Driving military car gets you benefits:

🛞 you never get stopped exceeding the speed limit (as there are none)

🛞 you never show your documents on outputs control (you are with the right guys)

🛞 you can travel by closed roads and bridges
The only what could stop us is concrete fence. It doesn't know that you have a brave volunteering mission.

So when I saw a very sudden turn, and I could not get into it I lowered speed from 130km/h to nearly stop at the fance and driven reverse to get into the turn. Extreme!
Read 6 tweets
Dec 2, 2021
Я долго терпел, но вот вам тред про виды багов:

🐞

Наебаги: баги, которые ты ищешь весь день, а оказывается, что их на самом деле нет - просто кто-то не отключил впн, не в ту вкладку посмотрел, не тот проект открыл, был пьяным всё сломалось, помогите, кря.
Заебаги: они постоянно приходят тебе в уведомлениях от sentry, но тебя они уже настолько заебажили, что ты даже не обращаешь на них внимания. А ЗРЯ!
Нагибаги: ложат стейджинг, продакшн, все тесты, а также все твои планы и личную жизнь. Не позволяй нагибагам заходить слишком глубоко!
Read 8 tweets
Dec 2, 2021
The fundamental problem of #web #development:

Turning trees into tables and back

(Thread 1/6)
It may seem simple as you may have some data in tables (hello, MySQL) and you want them on a web page (hi, <table>). But you start joining data from other tables and you end up displaying a tree in a table. How? You never know how to do it until you try to use that. UX!

(2/6)
But if you have tree-data, tree-database (hello, Mongo), and tree components on website, you still need tables to present the data of similar structure. It's all 2D and are brains are trained to get information presented as combination of 2 axes. Hello, tables!

(3/6)
Read 7 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(