• schnurrito@discuss.tchncs.de
    link
    fedilink
    arrow-up
    9
    ·
    13 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.

    • brianpeiris@lemmy.ca
      link
      fedilink
      English
      arrow-up
      2
      ·
      3 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
        2
        ·
        2 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
        ·
        3 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

    • qprimed@lemmy.ml
      link
      fedilink
      English
      arrow-up
      17
      ·
      12 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
      12
      ·
      12 hours ago

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

    • Riskable@programming.dev
      link
      fedilink
      English
      arrow-up
      2
      ·
      9 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.