Should you always pass the bare minimum data needed into a function
- by Anders Holmström
Let's say I have a function IsAdmin that checks whether a user is an admin. Let's also say that the admin checking is done by matching user id, name and password against some sort of rule (not important).
In my head there are then two possible function signatures for this:
public bool IsAdmin(User user);
public bool IsAdmin(int id, string name,…