• affiliate@lemmy.world
    link
    fedilink
    arrow-up
    72
    arrow-down
    2
    ·
    7 months ago

    back in my day we only had one language. it was called ASSEMBLY. wanted to make the computer do something? you had to ask it yourself. and that worked JUST FINE

  • pulaskiwasright@lemmy.ml
    link
    fedilink
    English
    arrow-up
    63
    arrow-down
    2
    ·
    7 months ago

    My favorite is “Java is slow” said by someone advocating for a language that’s at least 10 times slower.

    • kaffiene@lemmy.world
      link
      fedilink
      English
      arrow-up
      22
      arrow-down
      1
      ·
      7 months ago

      My favourite is “all the boilerplate” then they come up with go’s error checking where you repeat the same three lines after every function call so that 60% of your code is the same lines orlf error checking over and over

      • pulaskiwasright@lemmy.ml
        link
        fedilink
        English
        arrow-up
        2
        ·
        7 months ago

        And god help you if you forget those 3 lines somewhere and you silently have database failures or something else.

        • kaffiene@lemmy.world
          link
          fedilink
          English
          arrow-up
          2
          ·
          7 months ago

          Yeah, that’s the other thing - it does become easier to accidentally fail to deal with errors and the go adherents say they do all of that verbose BS to make error handling more robust. I actually like go, but there’s so much BS with ignoring the pain points in the language.

      • xtapa@discuss.tchncs.de
        link
        fedilink
        arrow-up
        2
        arrow-down
        1
        ·
        7 months ago

        When you handle all your errs the same way, I’d say you’re doing something wrong. You can build some pretty strong err trace wrapping errs. I also think it’s more readable than the average try catch block.

        • kaffiene@lemmy.world
          link
          fedilink
          English
          arrow-up
          2
          arrow-down
          1
          ·
          7 months ago

          You still need to add error handling to every call to every function that might raise an error

        • humbletightband@lemmy.dbzer0.com
          link
          fedilink
          arrow-up
          5
          ·
          7 months ago

          I wouldn’t say so. They are inexperienced. They don’t know where the bottleneck of most of the modern software is (it’s io in 80-90% of cases) and how to optimize software without rewriting it to C++

      • SorryQuick@lemmy.ca
        link
        fedilink
        arrow-up
        5
        arrow-down
        9
        ·
        edit-2
        7 months ago

        How are they ignorant? It’s a known fact that java is slow, at least slower than some others. Sure, it’s still fast enough for 95% of use cases, but most code will run faster if written in, say, C. Will have 10x the amount of code and twice as many bugs though.

        • humbletightband@lemmy.dbzer0.com
          link
          fedilink
          arrow-up
          5
          arrow-down
          3
          ·
          edit-2
          7 months ago

          Java is indeed slower than C, Rust, in some cases than Go.

          But that doesn’t mean that

          code will run faster if written in, say, C

          Again, like 80-90% of production code are bounded by disk/network io operations. You will gain performance from using C in embedded systems and in heavy calculations (games, trading, simulations) only.

          • SorryQuick@lemmy.ca
            link
            fedilink
            arrow-up
            3
            arrow-down
            3
            ·
            7 months ago

            Which is exaxtly what I said, that it’s fast enough for most use cases.

            In theory though, you will “gain performance” by rewriting it (well) in C for literally anything. Even if it’s disk/io, the actual time spent in your code will be lower, while the time spent in kernel mode will be just as long.

            For example, you are running a server which reads files and returns data based on said files. The act of reading the file won’t be much faster, but if written in C, your parsers and actual logic behind what to do with the file will be.

            But it’s as you said, this actual tiny performance gain isn’t worth it over development/resource cost most of the time.

        • xor@infosec.pub
          link
          fedilink
          arrow-up
          1
          arrow-down
          7
          ·
          7 months ago

          the jvm brings enough bugs to outweigh any benefits there…
          it is relatively fast, but it’s slow in that it takes up a bunch of resources that could be doing other things…

  • invertedspear@lemm.ee
    link
    fedilink
    arrow-up
    40
    arrow-down
    7
    ·
    edit-2
    7 months ago

    One project I worked on had 10 different languages. That was rough. But even your basic full stack web application is usually 5 languages: SQL, a backend language, HTML, CSS and JS. Usually some wheel reinventing frameworks thrown in for good measure. 5 languages is light these days.

    • CodeMonkey@programming.dev
      link
      fedilink
      arrow-up
      3
      ·
      7 months ago

      I work in Java, Golang, Python, with Helm, CircleCI, bash scripts, Makefiles, Terraform, and Terragrunt for testing and deployment. There are other teams handling the C++ and SQL (plus whatever dark magic QA uses).

  • kaffiene@lemmy.world
    link
    fedilink
    English
    arrow-up
    23
    arrow-down
    3
    ·
    7 months ago

    Java is a great language. But programming languages are tools - not every tool is the right tool for every job

  • nickwitha_k (he/him)@lemmy.sdf.org
    link
    fedilink
    arrow-up
    22
    arrow-down
    3
    ·
    7 months ago

    Seems reasonable to me. A scripting language, a compiled language, SQL, some CI/CD DSL, and a dealer’s choice.

    Java isn’t bad but, I’m not a fan of how verbose and convoluted it is. That said, I’ll take Java over here JS any day of the week.

  • Riskable@programming.dev
    link
    fedilink
    English
    arrow-up
    23
    arrow-down
    5
    ·
    7 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 🤷

      • Restaldt@lemm.ee
        link
        fedilink
        English
        arrow-up
        20
        arrow-down
        2
        ·
        7 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

        • msage@programming.dev
          link
          fedilink
          arrow-up
          11
          ·
          7 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.

          • Restaldt@lemm.ee
            link
            fedilink
            English
            arrow-up
            4
            ·
            edit-2
            7 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?

        • dezvous@lemmy.world
          link
          fedilink
          arrow-up
          5
          ·
          7 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

      • KairuByte@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        4
        arrow-down
        3
        ·
        7 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.

        • brian@programming.dev
          link
          fedilink
          arrow-up
          4
          arrow-down
          1
          ·
          7 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

          • KairuByte@lemmy.dbzer0.com
            link
            fedilink
            arrow-up
            1
            arrow-down
            3
            ·
            7 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.

            • brian@programming.dev
              link
              fedilink
              arrow-up
              3
              ·
              7 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

        • CanadaPlus@lemmy.sdf.org
          link
          fedilink
          arrow-up
          6
          arrow-down
          3
          ·
          edit-2
          7 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.

          • KairuByte@lemmy.dbzer0.com
            link
            fedilink
            arrow-up
            2
            arrow-down
            1
            ·
            edit-2
            7 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

            • CanadaPlus@lemmy.sdf.org
              link
              fedilink
              arrow-up
              5
              ·
              7 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.

              • KairuByte@lemmy.dbzer0.com
                link
                fedilink
                arrow-up
                2
                arrow-down
                1
                ·
                7 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.

                • CanadaPlus@lemmy.sdf.org
                  link
                  fedilink
                  arrow-up
                  3
                  ·
                  edit-2
                  7 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.

            • sacredfire@programming.dev
              link
              fedilink
              arrow-up
              1
              ·
              7 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.

  • jjjalljs@ttrpg.network
    link
    fedilink
    arrow-up
    11
    arrow-down
    1
    ·
    7 months ago

    The python code we inherited had some performance issues. One of the guys was like “we should rewrite this in Java”.

    Luckily the boss was not an insane person and shut that down. The issue was an entirely stupid “…and then we do one query per project” behavior that worked fine when the company was small but unsurprisingly started to suck as users created more projects.

    Instead of a months long complete rewrite, we had a two hour “let’s add profiling… Oh wow that’s a lot of queries” session.

  • Aceticon@lemmy.world
    link
    fedilink
    arrow-up
    8
    ·
    7 months ago

    I would say that over a decade of my career was coming in as a freelancer to fix codebases where a couple of people tought they knew better than the previous ones and proceeded to add yet another very different block to a codebase already spaghetiffied by a couple such people.

    Sometimes it was coding style, sometimes it was software design, sometimes it was even a different language.

    I reckon thinking that just deploying one’s EliteZ skills on top of an existing code base without actually refactoring the whole thing will make it better is a phase we all go through when we’re still puppy-coders.

    • ChickenLadyLovesLife@lemmy.world
      link
      fedilink
      English
      arrow-up
      5
      ·
      7 months ago

      The majority of puppy-coders I’ve encountered (including myself) actually want to refactor rather than just add onto. They are fundamentally correct in this, but they don’t grasp that 1) few companies want to acknowledge that the code base which is their greatest tangible “asset” is actually complete shit, and 2) that due to their inexperience, their refactored replacement is probably going to end up as bad as or worse than the original.