Here is the concept from the DB normalization theory:
The third normal form is violated when the non-key field is a fact about another non-key field.
Does it make sense to use a similar concept for functions / function parameters?
Consider the following function:
function validate(field, rule_name, rule_value);
// Usage
validate("password", "min_length", 6);
validate("password", "matches_regex", "/^\S+$/");
In this exemplary function, the third parameter describes the second and does not seem to be βrelatedβ to the first. This is like a denormalized function.
I donβt know if I am articulating this right, but I can notice an analogy between table names and table fields in DB, function names and function parameters.
If such an analogy makes sense, wouldn't it also make sense for function designers to borrow concepts from DB normalization theory?