04/07/2022
Should every function be, at worst, unary?
You have basically three ways to convey the intended reason behind functions existence.
- Name
- Body
- Parameters
The parameters name, if you look at it from the point of view of the arguments of the functions invocation, can convey only a little information, which is not even visible at the first sight and thus not very intuitive.
As for me, the function should not have more than two arguments. Every time, you need more, you can always turn that into a single Object-based argument. This have one side-benefit: Objects' properties add more information about the reason for the existence of the given parameter - you have there always the name of the property, which you can use to convey this additional information.