• affiliate@lemmy.world
    link
    fedilink
    arrow-up
    72
    arrow-down
    2
    ·
    2 years 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
    ·
    2 years 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
      21
      arrow-down
      1
      ·
      2 years 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
        ·
        2 years 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
          ·
          2 years 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
        ·
        2 years 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
          ·
          2 years 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
          ·
          2 years 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
        6
        arrow-down
        9
        ·
        2 years 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
          4
          arrow-down
          3
          ·
          edit-2
          2 years 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
            4
            arrow-down
            3
            ·
            2 years 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
          6
          ·
          2 years 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
    42
    arrow-down
    7
    ·
    2 years ago

    One project I worked on has 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
      4
      ·
      2 years 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
    21
    arrow-down
    3
    ·
    2 years ago

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

  • Riskable@programming.dev
    link
    fedilink
    English
    arrow-up
    21
    arrow-down
    5
    ·
    2 years 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
        ·
        2 years 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
          ·
          2 years 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
            ·
            2 years 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
          6
          ·
          2 years 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@lemmynsfw.com
        link
        fedilink
        arrow-up
        4
        arrow-down
        1
        ·
        edit-2
        2 years 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.

    • treechicken@lemmy.worldOP
      link
      fedilink
      arrow-up
      16
      arrow-down
      2
      ·
      2 years ago

      This is literally how this all started for us lol. Senior wanted to try to migrate everything to Kotlin in our project. Migration never finished. Now one of our major repos is just half Kotlin half Java. Devs on our team learn Kotlin by unexpectedly encountering it when they need to touch that code.

      • monsieur_hackerman@programming.dev
        link
        fedilink
        arrow-up
        9
        ·
        2 years ago

        Maybe it’s because I know both languages but is that really a big issue for people? The interop is great, and kotlin is very readable, so the cost of context switching between the two is miniscule.

        Some people have an extreme aversion to learning new things though. I feel that holding yourself to the standards and limits of your lowest performers isn’t a great thing.

      • mstrk@lemmy.world
        link
        fedilink
        arrow-up
        3
        ·
        2 years ago

        Doesn’t Kotlin has interoperability with Java? I didn’t used it much yet but I’m about to in a few months. Is it that difficult to just refactor things to Kotlin when you need to change something in the project? I’m asking because I just can’t work with verbose languages and would prefer Kotlin to Java everyday.

        • treechicken@lemmy.worldOP
          link
          fedilink
          arrow-up
          1
          ·
          2 years ago

          The interoperability is both a blessing and a curse imo since it let us half-ass the integration by leaving a bunch of Java code unconverted. I could start refactoring everything but then my team would stop reviewing my PRs due to the diff size (and then my manager would eventually find out that I’ve been using up work time doing this instead of shipping features during crunch week).

          I really much prefer Kotlin to Java. I just wish my team had actually had a commitment to it instead of just sorta using it with no migration plan.

      • masterspace@lemmy.ca
        link
        fedilink
        English
        arrow-up
        5
        arrow-down
        2
        ·
        2 years ago

        Sounds like you’re making progress, your devs are slowly learning a better language that will let them work faster and will soon be able to help port the rest of the codebase and then you can really accelerate when no one needs to touch or know Java.

        • treechicken@lemmy.worldOP
          link
          fedilink
          arrow-up
          2
          ·
          2 years ago

          I really hope so. Last code I reviewed was full of !! and companion objects trying to emulate Java static instead of top-level consts. Even I’m still trying to figure out what idiomatic Kotlin looks like. We got a ways to go…

    • force@lemmy.world
      link
      fedilink
      arrow-up
      3
      ·
      edit-2
      2 years ago

      Just use Scala*** ((objectively better language¹))

      1. scala does not support breaking out of loops, it does errors on early returns, uses parentheses for array indexing, compiles extremely slowly, …
  • Aceticon@lemmy.world
    link
    fedilink
    arrow-up
    9
    ·
    2 years 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
      ·
      2 years 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.

  • jjjalljs@ttrpg.network
    link
    fedilink
    arrow-up
    10
    arrow-down
    1
    ·
    2 years 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.