Dear php. You weren't my first one. But you were my first serious one. The first i made money with. We had a great time together until ajax came. Do you remember? I did more and more with js later but you still where my main. You even exposed your source code to me. Time changed. They started to hate you. And yes, they where right in some points. But they never saw your good sides. I saw them. I stood with you. But i was froced to wrote backends in typescript, in Java. And you know what: i didn't feel so bad. For gods sake, I fucking enjoyed it, php!

When did we become so alienated? When did I staet to write my dayly heller scripts in bash instead of you?

Yes, you improved. Hack came, than php7, php8. You archived a lot. You finally brought types. There was a time when I thought everything that stood between us will be overcome. That we will be together forever.

But recently i had this conversation on DevRant with nmeri and did some research afterwards. And I learned, maybe you will never have generics. It just don't work out, php, I am sorry. It's not your fault, it's mine. But i dont think i can live without a proper type system for the rest of my life. Not after i taszed those other languages.
I don't know when it will happen. When i switch projects this summer maybe. Maybe next year, when i start a new job. Who knows. But it will happen: you won't be my main anymore at one point. Maybe we can stay friends but i want you to know, that i am open for something new in my life. Something with generics.

  • 4
    **Me having a successful career in php never getting even close to needing to use generics**

    Oh cool man!
  • 2
    successful career, sure. I still do PHP most of the day atm, and i do what ever they pay me for. But i realized that at this point whenever can influence it, i wouldn't push things in the direction of PHP anymore, regardless how good I am at it.

    At this point I have no idea what I would use for a backend when I had the free choice (which is never the case in working context, so this is a merely theoretical question). I like Typescript at as language a lot, but i am not convinced that it's a good idea to use it for backend. Soon I will most likely be switched to a project which does, so I will see how that works out. My java experience was surprisingly good, but it doesn't feel like it could become "my new thing" actually.
  • 1
    Hmm you can have union types but that still feels a bit like a workaround. With traits i.c.m. interfaces I feel there is enough support for deduplicating code.

    That is just my personal experience not saying there might not be valid use cases.
  • 1
    Yes, PHP has improved A LOT (thanks Facebook!), but compared to other languages (and their features) it still feels at least ten years behind.

    In my opinion, it comes down to either a) maintaining a legacy PHP code base (which profits immensely from newer PHP versions) or b) creating something new from scratch. Why should a company invest in PHP nowadays? There are too many pitfalls and shortcomings compared to other languages.

    And if you are a junior dev who is interested in web/backend development, you will have a much nicer time with JS/TS.
Add Comment