• SlikPikker
    link
    fedilink
    English
    arrow-up
    20
    arrow-down
    1
    ·
    1 year ago

    PHP is actually a really nice language to work with both for web and command line utils

    Pervert.

    • Phoenixz
      link
      fedilink
      arrow-up
      4
      arrow-down
      3
      ·
      1 year ago

      Yeah, why?

      I know it’s popular to bitch on php but I’ve found it’s all for the wrong reasons. The vast majority of the internet still runs on it and it’s a breeze to work with, I love it. It’s safe, it’s fast, it’s great.

      I’ve worked with a variety of JavaScript frameworks and they all give me headaches.

      • SlikPikker
        link
        fedilink
        English
        arrow-up
        9
        arrow-down
        1
        ·
        1 year ago

        It’s just that it’s an ugly and weak language, overly verbose, and riddled with inconsistencies. There are few good things you can do in PHP without huge frameworks.

        • Phoenixz
          link
          fedilink
          arrow-up
          2
          ·
          1 year ago

          Not sure what qualifies as ugly but I find PHP codes much easier to read than JavaScript (if that is what you meant)

          If with weak you mean weak typed then you’re partially correct: most of it can be typed and ever since … I dunno, years ago, I’ve worked exclusively with strict typing. Things have improved considerably on that front

          What part is verbose? Genuine curiosity

          The inconsistencies are true. It’s also PHP’s strength that they kept everything like that and kept everything compatible. Every JavaScript framework I have worked with caused the weekly update nightmare headaches where 5 bugs were resolved, but now 10 more were added due to changing method calls. I hated it and I love PHP for at least keeping that consistency. Over time they have worked little by little to mitigate things but at the core, yes, you have function call inconsistencies. However, good editors these days for that for you and tell you the function name and give you the parameter order.

          Then that there are few good things you can dowithout frameworks is nonsense.

          If you want to do it right you use a framework, but that goes for every language. But I’ve sen and worked on (admittedly a horrible) system that would scrape millions of pages per day and its first version was just hacked together code. Ugly but super quick and simple, no frameworks. I’ve built many similar systems and sites like it over the years.

          Now I recently built my own new framework in PHP, all strict, and it’s just fast and beautiful

          • SlikPikker
            link
            fedilink
            English
            arrow-up
            5
            ·
            1 year ago

            You’re comparing to only JavaScript, have you worked with another language like python, ruby, lisp, rust? Maybe then you’d see what I mean.

            By verbose I mean that mostly PHP lacks syntactic sugar, mostly it lacks powerful features of other languages. You can mostly write very simple procedural code.

            • Phoenixz
              link
              fedilink
              arrow-up
              1
              ·
              1 year ago

              Well I compare to JavaScript because that’s what most people bring up. On web development, I guess JavaScript is the biggest competitor.

              I’ve worked with many languages. I even worked with assembly for a while in another life over 25 years ago, I worked with visual basic, .net, c, c++, Java, JavaScript and it’s many frameworks, loads other more obscure languages too, and I’ve played with some python over the years. Still though, php has my favorite since a loooong time

              Can you give an example of missing syntactic sugar or features that are missing?

              • SlikPikker
                link
                fedilink
                English
                arrow-up
                1
                ·
                1 year ago

                Type hints and comprehensions as in Python, borrow checker, traits, code interface checking in Rust. Most functional features.

                IDK; I just don’t like anything about PHP and I have worked with it. It seems bad at every task.

                • Phoenixz
                  link
                  fedilink
                  arrow-up
                  1
                  ·
                  1 year ago

                  Type hinting? There. Traits? There. Interfaces? There. I could go on but PHP has all these features that people keep saying are missing.

                  I’m not saying you don’t have to like PHP, everyone likes there own labgua and that’s fine.

                  However, people keep making shit up about phpt and then use that shit to smear it and it’s annoying. PHP is great for web sites, small and complicated, it’s great for command line scripting, it’s great for a large list of tasks and it seems that what you need is there.

                  • SlikPikker
                    link
                    fedilink
                    English
                    arrow-up
                    1
                    ·
                    1 year ago

                    It doesn’t really count if you need a huge framework for it. Frankly I never saw PHP used well, and I never saw it do anything better than other languages can do.