• thisfro@slrpnk.net
    link
    fedilink
    arrow-up
    36
    ·
    1 year ago

    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.

    • SokathHisEyesOpen@lemmy.ml
      link
      fedilink
      English
      arrow-up
      16
      arrow-down
      4
      ·
      1 year ago

      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.

    • PlexSheep@feddit.de
      link
      fedilink
      arrow-up
      10
      ·
      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
      link
      fedilink
      English
      arrow-up
      7
      arrow-down
      3
      ·
      1 year ago

      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

      • thisfro@slrpnk.net
        link
        fedilink
        arrow-up
        1
        ·
        1 year ago

        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
          link
          fedilink
          English
          arrow-up
          1
          ·
          1 year ago

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

          • thisfro@slrpnk.net
            link
            fedilink
            arrow-up
            2
            ·
            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
      link
      fedilink
      English
      arrow-up
      2
      arrow-down
      5
      ·
      1 year ago

      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
        link
        fedilink
        English
        arrow-up
        3
        ·
        1 year ago

        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

    • zeppo@lemmy.world
      link
      fedilink
      English
      arrow-up
      2
      arrow-down
      13
      ·
      1 year ago

      For the backend? Why? I could see PHP being better for the front end considering it’s basically a templating language already, and setting up Python on a webserver is much more complex, last I tried.

        • zeppo@lemmy.world
          link
          fedilink
          English
          arrow-up
          1
          arrow-down
          4
          ·
          edit-2
          1 year ago

          Oh, I see what you mean. I thought you meant output HTML and templating vs server side logic, but yes, obviously I know the difference as the only front-end language is JavaScript and derivatives.

          I’m more used to the terms ‘server-side’ and ‘client-side’ btw. Obviously PHP is server-side. But not all server-side is backend in my view. I consider backend to be application logic and things like database access. Templating can be done on the server or the client, and that’s front-end.