Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method calls: favour argument bags over individual arguments #27

Open
coderbyheart opened this issue Aug 24, 2019 · 0 comments
Open

Method calls: favour argument bags over individual arguments #27

coderbyheart opened this issue Aug 24, 2019 · 0 comments

Comments

@coderbyheart
Copy link
Owner

coderbyheart commented Aug 24, 2019

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.

@coderbyheart coderbyheart added needs explanation This issue needs a better explanation and removed needs explanation This issue needs a better explanation labels Aug 26, 2019
@coderbyheart coderbyheart changed the title Method calls: favour argument bags over individual bags Method calls: favour argument bags over individual arguments Aug 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant