My colleague and I discuss best practices regarding order method parameters. The goal is to set the standard in our organization to improve readability and performance by providing common signatures to our methods. We just make recommendations for the recent graduates we hire.
Example (userId is always passed to audit calls):
GetOrders (string userId, int customerId); GetOrders (string userId, int [] orderIds); GetCustomer (string userId, int customerId);
My argument is as follows:
- most common arguments are common.
- other arguments are based on importance
- optional (null) arguments to last.
His argument is essentially the opposite.
I am not asking for a right or wrong answer here, nor for discussion. I just want to see what standards already exist.
Thanks!
oop coding-style
Bloodhound
source share