• CodexArcanum@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    13
    ·
    12 hours ago

    Good IDEs have multiple ways of showing you this info, and many languages have named parameters that fix this. Also, just putting a comment on them is not a crime, it just won’t update when you change the function but then your IDE can often only do so much at call sites, so you often need to update the calls (and the comments) manually. I’m sure LLM agents can change both as well.

    Or, in JavaScript like these examples were, yeah, just pass in an object. Passing in an object should be standard in JS when you have more than like 2 params anyway because it solves several issues with parameter identification, optional parsms, method overloading, and so on. And JS passes everything by reference so you aren’t losing performance.

      • draco_aeneus@mander.xyz
        link
        fedilink
        English
        arrow-up
        1
        ·
        2 hours ago

        Indeed. There will be lots of times when you’ll be reading code without a while IDE attached. When doing code reviews in the browser, when looking at patch files or git diffs in the command line, when browsing code files on some git host, or when you’ve gone to a confrence and you left your laptop in the hotel room because Steve from accounting assured you it would just be a meet-and-greet with clients, but then some production bug hit and every odd-numbered request is returning a 401 for some reason, so you need to borrow Steve’s laptop to fix this.