• schnurrito@discuss.tchncs.de
    link
    fedilink
    arrow-up
    9
    arrow-down
    1
    ·
    23 hours ago

    That’s why IntelliJ shows you, in these kinds of cases, the names of the parameters where the function is called…

    There are also languages, like Scala and Swift, with named parameters, which also solve this problem.

    • qprimed@lemmy.ml
      link
      fedilink
      English
      arrow-up
      19
      arrow-down
      1
      ·
      23 hours ago

      but isn’t that just using tooling to de-obfuscate code that should be clear to begin with?

      passing structs, dicts, whatever keeps the code clear, expressive and extensible. if I can bake-in flexibility and clarity without being overly focused on performance, I am choosing the former every time.

    • nous@programming.dev
      link
      fedilink
      English
      arrow-up
      13
      ·
      23 hours ago

      You shouldn’t need tooling to fix an issue. Better for a design that does not require extra tooling.

    • brianpeiris@lemmy.ca
      link
      fedilink
      English
      arrow-up
      2
      arrow-down
      1
      ·
      14 hours ago

      IntelliJ doesn’t help when you’re doing a code review, or just reading through hundreds of lines of code, I don’t want to move my mouse or cursor over every line to see the parameter names.

      • draco_aeneus@mander.xyz
        link
        fedilink
        English
        arrow-up
        3
        ·
        13 hours ago

        I agree with you. However, I think you’ve misunderstood what inlay hints look like. Here’s an example.

        IntelliJ inlay hint example

      • Traister101@lemmy.today
        link
        fedilink
        arrow-up
        1
        ·
        14 hours ago

        By default inlay hints are enabled so you wouldn’t have to do that. But yeah it’s tied to using the editor which makes it a non solution

    • Riskable@programming.dev
      link
      fedilink
      English
      arrow-up
      2
      arrow-down
      3
      ·
      20 hours ago

      If your language requires an IDE to show you WTF is going on in the code, it’s a bad language.

      Given, there’s ways to write poor code in any language, but some are much, much worse than others. Java and JavaScript being the kings of that kind of thing.

      Some day, AI assisted coding will become so intelligent that it will look at your average “enterprise” Java code and ask the user, “WTF were they even trying to do here?” Which is the only correct response a lot of the time.

      • sbeak@sopuli.xyz
        link
        fedilink
        English
        arrow-up
        1
        ·
        3 hours ago

        Conversely, most software developers look at LLM-gen (LLMs are not proper artificial intelligence since they don’t understand what you’re feeding it) code and say “WTF were they even trying to do here?”

        Indeed, AI (not LLMs, mind you, but AI) does have its use cases. For instance, in science, there are many fields where mass processing of data by conventional means is unfeasible. And in programming, using AI to help detect bugs so that an experienced developer, knowing how to troubleshoot and with context of the project’s aims and scope, can fix the issue more easily.

        LLM-gen code is very fragile and filled with loads of bugs, not to mention how the code it writes does not credit the original authors, as it ignores licensing and attribution requirements of projects that were scraped for its data set. And half the time, people producing LLM-gen code do not understand what it has produced and does not bother to review it before trying to push it to a large project, leaving the burden of filtering it out for those maintaining the project (when that effort could be directed at adding new features, fixing bugs, or doing anything else really)