Why do you hate PHP so much?

Why do you hate PHP so much?

  1. 2 weeks ago
    Anonymous

    I don't. It's THE best language to quickly get something half decent out there. If you put in 10% effort it can even be decent. It's just that simple.

    • 2 weeks ago
      Anonymous

      At best it's no simpler than any other lang. This argument was compelling when the alternatives were Perl or Java.

    • 2 weeks ago
      Anonymous

      >node ecosystem
      >for a backend
      >blazor is exotic
      ...you're probably not a very good programmer

  2. 2 weeks ago
    Anonymous

    I don't hate it but it's rather hard for it to be competitive with the node ecosystem or than even some rather exotic solutions like Blazor.

    t. former PHP dev of 8 years

  3. 2 weeks ago
    Anonymous

    it's just a bad language

    • 2 weeks ago
      Anonymous

      90% chance you've seen one indian php tutorial or a bunch of redditors parrot old crap.

      • 2 weeks ago
        Anonymous

        Either that or he's posting right from 2004.

      • 2 weeks ago
        Anonymous

        Been programming since the 80s and have used PHP since 2000 (first project an educational tool to help music theory students understand the 12-tone system). I still program with it today although only legacy projects.
        PHP is bad. Bad language, bad ecosystem. I even find Perl preferable to PHP.
        I don't blame people for using it. Use whatever gets the job done and there's a lot of support for generic backend webshit. Just don't pretend it's good.

        Either that or he's posting right from 2004.

        Not that either.
        So what if PHP has improved? So has every other language and they didn't start out so far behind.

        • 2 weeks ago
          Anonymous

          >PHP is bad. Bad language, bad ecosystem. I even find Perl preferable to PHP..
          >it is ... le bad
          Ok, but nobody asked for your life story.

        • 2 weeks ago
          Anonymous

          >bad ecosystem
          Bait or mental illness

          • 2 weeks ago
            Anonymous

            Ecosystem is ok for web stuff but once you step outside of that, so if you want to add something less typical you often find that the only good libraries for doing it are all in other languages, so you end with microservices even if you don't want that.

            • 2 weeks ago
              Anonymous

              >coding in PHP ends in microservice
              most PHP codebases end up as monoliths though?

  4. 2 weeks ago
    Anonymous

    I like PHP

    I wish it had some features from other languages like "everything is an object" so you can do "foo".upper() and stuff.

    • 2 weeks ago
      Anonymous

      strtoupper($foo);
      Really odd thing to wish for.
      Are you sure you like PHP?

      • 2 weeks ago
        Anonymous

        I suppose the benefit is chaining so you can do:

        var matches=foo.upper().match(/([A-Z]+) ([0-9])/);
        instead of preg_match("/blah/",strtoupper($foo),$matches);

        It "flows" better. But this is maybe one of those situations where perhaps you really shouldn't do either one.

        • 2 weeks ago
          Anonymous

          Exactly, it just looks nicer.
          You can do the same stuff in PHP and other languages, but sometimes they are just better looking.

    • 2 weeks ago
      Anonymous

      You can kinda do this with the illuminate support package (included with Laravel by default), allowing you to chain string methods. str($string)->upper()

  5. 2 weeks ago
    Anonymous

    What I want to know is why did we abandon mod_* integration into apache? mod_perl was how you got high performance dynamic scripting back in the early days, mod_php copied its homework to take over the entire internet, but if you want to use python or node you're expected to abandon the entire workflow and ramshackle cgi, fpm or worse, use the bundled web server instead of apache...

    • 2 weeks ago
      Anonymous

      people don't want to be chained to apache

      • 2 weeks ago
        Anonymous

        Implying there aren't options.

        • 2 weeks ago
          Anonymous

          You're replying to a post about why we moved away from Apache mods as integrations with PHP. There are no real direct alternatives to that, and people wanting to be able to use alternative web hosts was the reason we stopped doing it.

        • 2 weeks ago
          Anonymous

          Didn't imply that

    • 2 weeks ago
      Anonymous

      >he thinks he needs a web server with node
      new here?

  6. 2 weeks ago
    Anonymous

    Because the future (which already arrived more than 5 years ago, only you stopped in time) is serverless.

    You won't have a server and you'll be happy.

    • 2 weeks ago
      Anonymous

      There is a bult-in server inside PHP interpreter. Just saying.

    • 2 weeks ago
      Anonymous

      >Because the future (which already arrived more than 5 years ago, only you stopped in time) is serverless.

      You're late https://github.com/vercel-community/php

  7. 2 weeks ago
    Anonymous

    Honestly I don't hate the language. But when I walk into some business and inherit a shitty code base, there's a very strong likelyhood that PHP == some guy in India with extremely poor coding skills built this app and now it's my problem.

    I don't tend to run into this with other platforms. PHP tends to have a lot of issues with people that did a Durgasoft course five years ago and now write most of its new codebases.

  8. 2 weeks ago
    Anonymous

    PHP is very progressive - https://www.php.net/manual/en/class.gender.php

    • 2 weeks ago
      Anonymous

      My gender? My gender is int 8 or french, I'm a homosexual you see.

    • 2 weeks ago
      Anonymous

      I'm a transnagger, where is my representation?

  9. 2 weeks ago
    Anonymous

    I have no idea why PHP gets the hate it does when LETS DO IT ALL WITH JAVASCRIPT exists.

    Maybe people dont like PHP because they are bad programmers? I know that sounds like seethe but JS is far better at being shitty than php.

    • 2 weeks ago
      Anonymous

      Modern PHP is fine.
      Old PHP is cancerous and most hate is from grandfathered projects people had to deal with.

      • 2 weeks ago
        Anonymous

        >and most hate is from grandfathered projects people had to deal with.
        Zoomers unironically make memes making fun of PHP without having tried it.

        • 2 weeks ago
          Anonymous

          Yes, and millenials hate COBOL, it's a historical trend.

      • 2 weeks ago
        Anonymous

        You guys probably think a grandfathered project is something 5 years old.
        I have clients fretting that support for php 7.4 is dropped already and they aren't ready to updoot to 8. In contrast, Python hasn't released a major version since 2008. R still supports v3. Clojure has been version 1 since 2009 and is still on version 1.

    • 2 weeks ago
      Anonymous

      PHP gets hate in this thread because that's the topic. Typical PHP dev filtered by basic stats anysis.

    • 2 weeks ago
      Anonymous

      >I have no idea why PHP gets the hate it does when LETS DO IT ALL WITH JAVASCRIPT exists.
      This. PHP is much simpler and looks much nicer than muh JS async hell, yet people say they hate one and love the other.

    • 2 weeks ago
      Anonymous

      Idk JS is pretty bad.

  10. 2 weeks ago
    Anonymous

    Weakly typed languages are brain damaged. All of them.

  11. 2 weeks ago
    Anonymous

    Modern PHP is not much different from Python or Ruby. Still a solid choice for web apps, but hey, we don't need web apps anymore.

  12. 2 weeks ago
    Anonymous

    I don't. It is super comfy. I actually like using it for simple scripts as much or more than Python.

  13. 2 weeks ago
    Anonymous

    cuz

  14. 2 weeks ago
    Anonymous

    Trannies use it

  15. 2 weeks ago
    Anonymous

    >Why do you hate PHP so much?
    Because WordPress

  16. 2 weeks ago
    Anonymous

    Php has worse performance than Javascript with developer experience and safety of c. No idea why you'd go for it after 2015 or so.

    • 2 weeks ago
      Anonymous

      that's bullshit, all IO operations are faster in PHP because you invoke native extension written in C directly. so first, V8 was designed to be used as a browser runtime. every operation has to get through this browser crust/sandbox/validation before it invokes a native function. second, when designing something to be used as a client application, you're going make heavier use of RAM and caching. you want the complete opposite on the server, smaller RAM footprint being better becuase you are serving more than one user. an idle nodejs process takes about 25MB RAM while a PHP process takes 2MB. that's why the event loop becomes a complete meme because you can just start 10 times as many PHP processes for every node process.

      • 2 weeks ago
        Anonymous

        If you're running outside of a browser then you aren't using the browser sandbox. But regardless any fixed overhead for IO is going to be dwarfed by the time spend waiting for the actual IO to be performed.

        > an idle nodejs process takes about 25MB RAM
        You can serve as many requests as you would like from a single process in node. With PHP you tend to end up with one process or thread per connection (although granted there are ways around with this).

        • 2 weeks ago
          Anonymous

          >You can serve as many requests as you would like from a single process in node.
          you can't seriously believe that you can run a website with millions of request with one server and one node process. you will have to do multiprocessing with cluster, child_process or worker_threads the same way how you would do it with PHP. except the PHP processes are scheduled by the OS which makes it perform better on multi-core CPUs.

          It does look not quite as bad in web. Tech empower has, after meme js and php, standard php at 10% faster than standard nodejs.
          Laravel bloat less than half performance of express or koa shit.
          In computation benchmark game php gets shat on even by javascript.
          Just use go, java or aspnet. Much better performance, better dev experience, more libraries. Java the worst of the bunch and still usable compared to php.

          >Just use go
          i agree, but those CPU intensive benchmarks are misleading because that's not a realistic use case for a server application. a DB select of 5MB and a json serialization of that data will be faster in PHP because that's just two invocations to C libraries. google results are completely worthless with SEO spam, so i can't find that benchmark unfortunately.

          • 2 weeks ago
            Anonymous

            >you can't seriously believe that you can run a website with millions of request with one server and one node process
            Yes, easily

        • 2 weeks ago
          Anonymous

          >Duuuuude, just write your entire application in this exact mental gymnastics way or else literally anything you do blocks your entire single-threaded server
          Node is naggerlicious.

          • 2 weeks ago
            Anonymous

            No, it's exactly the opposite of that. The entire node runtime is non blocking by default so you don't have the problem you get in Python where you can kill your application by mixing blocking and non blocking.

      • 2 weeks ago
        Anonymous

        It does look not quite as bad in web. Tech empower has, after meme js and php, standard php at 10% faster than standard nodejs.
        Laravel bloat less than half performance of express or koa shit.
        In computation benchmark game php gets shat on even by javascript.
        Just use go, java or aspnet. Much better performance, better dev experience, more libraries. Java the worst of the bunch and still usable compared to php.

        • 2 weeks ago
          Anonymous

          Techempower benchmarks are almost completely worthless.

          • 2 weeks ago
            Anonymous

            Pretty bad ye but still the only one we have. A lot of it has nothing like real code.
            >they have static string as current time and send that every time.

        • 2 weeks ago
          Anonymous

          Java is typed so it is automatically superior to php dynamic meme soup

  17. 2 weeks ago
    Anonymous

    Because it's boomer tier garbage and everything PHP related is about maintaining shitty codebase from 2006 or, even worse, Laravel.

  18. 2 weeks ago
    Anonymous

    I don't hate PHP. However, I very much hate the PHP projects I've had to work on.
    Man-made horrors that, sadly, are no longer beyond my comprehension.
    Every single one was a tangled mess, each in its own bizarre way. Detestable? Yes. Testable? No.
    All vanilla pre-7 PHP, no frameworks, no libraries. At least I get to bump them to 8.1 but that's about it.

    The language gets a lot of stuff right and there is certainly a case to be made for it. The inconsistent stdlib is annoying but it's not a deal-breaker.
    Like PHP, AWK is an otherwise terrible language taylor-made for a specific use-case and it's awesome because of it.

    Luckily, my job involves other things beside legacy PHP and I would never accept or stay at a job that doesn't.

    • 2 weeks ago
      Anonymous

      Frameworks are massively overrated.
      The problem with old PHP code isn't the lack of frameworks, it's that the kind of people who used php were rarely good programmers.

      • 2 weeks ago
        Anonymous

        I agree completely, should have worded it differently.

  19. 2 weeks ago
    Anonymous

    I learned perl first and PHP seems ridiculous to me
    https://web.archive.org/web/20130625070202/http://www.theperlreview.com/articles/php.html

    • 2 weeks ago
      Anonymous

      Weird, I'm not extremely experienced in PHP, but Perl looks like an unreadable mess to me while PHP is pretty easy to read.

      • 2 weeks ago
        Anonymous

        >Perl looks like an unreadable mess
        for you
        >while PHP is pretty easy to read.
        wait untill you see the 100 array functions and sort functions of PHP
        enjoy writing as many functions as in C because PHP can't into expressions

        • 2 weeks ago
          Anonymous

          I know, PHP does give off strong C vibes, and many parts of it are inconsistent. But I'm just talking about the basic syntax and the names of standard functions. Perl feels close to bash, with a bunch of cryptic abbreviations and meme symbols, while PHP feels more verbose and closer to a C syntax, which I'm already familiar with.

          • 2 weeks ago
            Anonymous

            >and many parts of it are inconsistent
            yes exactly, it's hard to find a more inconsistent language and it's a big reason why I can't fathom it
            >Perl feels close to bash
            it is very far from bash tbh, by a lot
            >meme symbols
            well, it does have lots of $, @ and % but they are not hard to understand
            >PHP feels closer to a C syntax, which I'm already familiar with.
            perl's control flow syntax is closer to C than virtually all scripting languages though (as compared to python, ruby, JS, lua, etc..), and concerning data structures it's closer to than the other scripting languages by a freaking mile, because of the semantics of references

            • 2 weeks ago
              Anonymous

              >and concerning data structures it's closer to
              C

  20. 2 weeks ago
    Anonymous

    Error checking is all over the place, combining sequential and associative arrays was a mistake, traits are half-assed, Unicode is half-assed, some functions aren't functions, strong metaprogramming requires eval, Laravel is too sloppy, autoloading only works with classes, I could go on. I don't quite hate it but the language is rotten.

  21. 2 weeks ago
    Anonymous

    because i hate webdev, next question

  22. 2 weeks ago
    Anonymous

    It sucks

  23. 2 weeks ago
    Anonymous

    I don't, I love Laravel so much. Laravel + Vue best web stack by far.

  24. 2 weeks ago
    Anonymous

    i broke up with my bf because he enjoyed using php, its a sign of mental sickness

  25. 2 weeks ago
    Anonymous

    I don't it's a perfectly useful language. It's a little ugly but that's about it. I tend to not use it much in my career anymore because it's harder to hire for

  26. 2 weeks ago
    Anonymous

    But I like PHP.
    PHP is fine.

Your email address will not be published. Required fields are marked *