• FizzyOrange@programming.dev
    link
    fedilink
    arrow-up
    12
    arrow-down
    1
    ·
    1 month ago

    I agree - Structs are kind of a nicer solution here. Especially because it’s pretty common to pass a whole set of options through the call stack.

    In Python land you end up with functions with 30 arguments and when they want to pass them anywhere they give up and use kwargs which are completely awful and should almost never be used.

    • TehPers@beehaw.org
      link
      fedilink
      English
      arrow-up
      5
      ·
      1 month ago

      In Python land you end up with functions with 30 arguments and when they want to pass them anywhere they give up and use kwargs which are completely awful and should almost never be used.

      Unpack[T] exists, but nobody uses it sadly. Also, it’s probably better to just use a dataclass or something instead anyway, but nobody does.

        • TehPers@beehaw.org
          link
          fedilink
          English
          arrow-up
          1
          ·
          30 days ago

          Their docs page just flat out doesn’t work on mobile, but based on the high level descriptions of the packages, these look like something I’d install on a project without asking and write in the AGENTS.md that it’s forbidden from using the more popular libraries in favor of those. (Our DS people, in general, can’t and won’t write code for shit, so it’s the only way to get them to use a new library.)

          • flying_sheep@lemmy.ml
            link
            fedilink
            arrow-up
            1
            ·
            30 days ago

            I think we helped improve that in our field since as I said, I’ve been making pleasant APIs for like 8 years there. But I know the struggle.