• Riskable
    link
    fedilink
    English
    259 months ago

    I’m failing to see the problem. As long as one of the languages isn’t PHP they’re still probably better off 🤷

      • @[email protected]
        link
        fedilink
        English
        219 months ago

        PHP5 was basically the Adolf Hitler of programming languages

        You know how something can be so terrible it ruins something forever? Like the hitler stache

        • @[email protected]
          link
          fedilink
          119 months ago

          5.3 was a big leap for PHP. It became actually very good at that point.

          I learned it when it was on 4 and boy oh boy was that something.

          But nowadays, with 8, it works great, tooling is fantastic. I just kinda wish the documentation, which is absolutely top notch for 90% of the language, was this good for the rest 10%.

          I want to play around with Fibers, but I just don’t get the info I want to.

          pthreads were so out of date in docs it was shameful.

          But the language is good, typing is coming along nicely, and basically the only thing I want PHP to do is to call Postgres and encode the output to json. Works like a charm.

          • @[email protected]
            link
            fedilink
            English
            4
            edit-2
            9 months ago

            Yeah i’ve heard good things about it recently. I’ve always liked how easy curl can be in php.

            Adding typing seems like it would fix most of the problems i did run into but

            Has PHP raised its standards on function naming? Or do you still have batshit situations like realEscapeString2() because the first 30 other functions for escaping strings are deprecated?

        • @[email protected]
          link
          fedilink
          69 months ago

          Lol okay maybe that’s true :) but PHP is great nowadays and with frameworks like Symfony and Larvel it’s easier than ever to build applications

      • @MyNamesNotRobert
        link
        4
        edit-2
        9 months ago

        If you get even 1 thing wrong, the entire program stops working and you don’t get any information about it. Turns out those cryptic errors like “error: object reference not set to instance of an object at address 0x007e00” are kind of important information to have. Unless you specifically know where it’s crashing, finding the source of the problem is like finding a needle in a haystack. If it’s your own code it’s borderline manageable but you’ll regret every decision that led you up to that point. If it’s someone else’s code such as an old project from 9 years ago that doesn’t work anymore, absolutely forget about it.

        The only advantage of php is that it’s incredibly lightweight. I was running an Athlon XP home server on Gentoo as late as 2022 and still had php running despite only having the SSE1 instruction set and a cpu less powerful than whats probably on a modern led lightbulb.

        But ACKTCHUALLY I think django and python bottles can be run on even shittier computers than php can since they’re both python programs and python has been demonstrated to be runnable on a pentium 1. So there is no reason to use php.

      • @[email protected]
        link
        fedilink
        49 months ago

        Both are fine tbh. Javascript has come a long way from a decade ago, and mixing in a decent framework like jquery does wonders.

        • @[email protected]
          link
          fedilink
          6
          edit-2
          9 months ago

          The type system is still really bad, and apparently TypeScript gets mixed with native libraries in common practice, which makes a bad situation worse when something breaks.

          Edit: Messed up the name, fixed.

          • @[email protected]
            link
            fedilink
            2
            edit-2
            9 months ago

            The typing system is just a “quirk”. As long as you understand the (admittedly annoying) exceptions to the way your brain expects typing to work, everything works quite well.

            And tbh, transpiled TypeScript libraries can be called from JavaScript as if it was JavaScript… because it is JavaScript. There’s no need to worry about typing unless you’re doing something like passing a string into a function that expects an int, and you’d run into those same problems if the function was originally JavaScript.

            Edit: a word

            • @[email protected]
              link
              fedilink
              59 months ago

              I mean, sure, but taking that argument to it’s logical extreme we should still be programming in assembly, because you can if you just know enough to do it.

              A language is a tool. If it’s harder to use successfully than the next tool it’s a worse tool.

              • @[email protected]
                link
                fedilink
                29 months ago

                No? How is that the logical conclusion? You need to understand any language, and any quirk of that language, in order to effectively write in it. JavaScript is powerful, and moving farther every iteration. Strong typing is just not something it takes into consideration. In the same way that C# doesn’t take white space into consideration, and python doesn’t terminate its instructions with semicolons.

                Each language is different, each language has its own quirks that you need to understand and get used to. If that wasn’t the case, we would have one objectively “perfect” programming language to use in all situations, on all machines, for every use case.

                • @[email protected]
                  link
                  fedilink
                  3
                  edit-2
                  9 months ago

                  You need to understand any language, and any quirk of that language, in order to effectively write in it.

                  That seems to imply they all have the same amount of quirks, which I think most people here would agree is untrue

                  Something like Haskell has far, far fewer quirks than x86 assembly code. It really only has quirks to do with interactivity; everything else is very predictable and visible in the code. Meanwhile, assembly code is but a maximally useful set of quirks in a specific electronic circuit.

                  Ditto if you look at older languages. FORTRAN is unpleasantly quirky, which is why it’s almost obsolete.

                  If that wasn’t the case, we would have one objectively “perfect” programming language to use in all situations, on all machines, for every use case.

                  I mean, I hold out hope that that will eventually happen, at least for the vast majority of use cases and machines. Obviously we’re not there yet.

                  There have been languages that basically dominate their own niche. C/C++ was almost the only game in town for performance coding until someone discovered a way to compile mid-level code while also guaranteeing memory safety. Memory errors were a terrible quirk, so now Rust might steal its crown.

            • @[email protected]
              link
              fedilink
              19 months ago

              I personally don’t think that’s the issue with the typing system. With vanilla js if I’m looking at a function that has say four parameters that are not trivial objects like strings but are actually complex (think dependency injection) it’s very difficult for me to know what these objects are other than reading through the code of the function.

              Actually, even if the parameters are simple, I’m not sure of that until I look into the function and see what it’s doing. This is a huge pain in the ass most the time, because I just wanna look at the function name its parameters and move on. However, that being said, most of this can be remedied with jsdocs and a good linter/lsp.

        • @[email protected]
          link
          fedilink
          49 months ago

          decent framework

          jquery

          It’s current year, you have to choose one. there really isn’t any reason to use jquery other than legacy code

          • @[email protected]
            link
            fedilink
            29 months ago

            Jquery is still extremely relevant. React exists as well, and is also a good framework. I just happened to think of jquery first.

            • @[email protected]
              link
              fedilink
              39 months ago

              what does jquery give you that vanilla js doesn’t? it was good before browser inconsistencies got ironed out and js didn’t have as many features built in, but nowadays I have no idea why someone would need it