Better for situations with individuals and their transactions.
transfer(payer, payee, amount);
Needs checks to be sure whether the payer is there or not.
Better when we have a large no of payers(may be in an array).
In bigger repositories it comes in handy, when you have defaults in place for payer. Obviously this does not make much sense for this particular example. But I've faced some situations where if the argument comes then behaviour is something else we have to switch to default.
As you can see there are pros and cons to both, personally I would prefer second approach as it gives us the flexibility to have defaults.
Most of the library developers tend to provide both the approaches.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
payer.transfer(payee, amount);
transfer(payer, payee, amount);
argument
comes then behaviour is something else we have to switch to default.As you can see there are pros and cons to both, personally I would prefer second approach as it gives us the flexibility to have defaults.
Most of the library developers tend to provide both the approaches.