Skip to content

Method calls: favour argument bags over individual arguments #27

Open
@coderbyheart

Description

@coderbyheart

Bad

myMethod(arg1, arg2, arg3)

Good

myMethod({arg1, arg2, arg3})

Reasons

  • this removes the Connascence of Position (CoP) because the order of arguments becomes irrelevant
  • arguments to methods can easier be created programmatically

Watch out for

  • removing support for currying

Thanks to

@ollin for pointing me to the connascence argument for this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions