• frezik
    link
    fedilink
    arrow-up
    3
    ·
    11 months ago

    There are plenty of other languages that have named parameters but no holding object. You format it like this:

    some_func(
        foo: 1,
        bar: 2,
        baz: 3,
    )
    

    And this works fine. Of course, not everyone does that, but I almost never see it done in Python.

    This style comes into conflict with rules that functions shouldn’t be longer than 20 lines for whatever. The solution to that is to be relaxed about the line count rule. I’d rather see 40 trivial lines than 20 with everything crammed up.

    • BehindTheBarrier@programming.dev
      link
      fedilink
      arrow-up
      1
      ·
      11 months ago

      Completely agree with that, we have the same issue in C# where I work. Just waiting for the day I get to push and update to our shared code style (editorconfig) to force that.