Method parameters confusion
- by elec
Often time methods take more than 3 parameters which are all of the same type, eg.
void mymethod (String param1, String param2, String param3)
then it's very easy for the client to mix up the parameters orders, for instance inverting param1 and param2:
mymethod (param2, param1, param3);
...which can be the cause of much time spent debugging what should be a trivial matter.
Any tips on how to avoid this sort of mistake (apart from unit tests) ?