5 ms·
It doesn't bother me that make_person_an_outside_subscriber_if_all_accesses_revoked is long, it bothers me that it seems too specific to be a method. Part of th
by columbo 14y ago
It doesn't bother me that make_person_an_outside_subscriber_if_all_accesses_revoked is long, it bothers me that it seems too specific to be a method. Part of the condition is in the method name (if_all..), that's something that really seems odd to me.
What if new requirements dictate that if the same thing should happen given a different condition (if all access is revoked or if the user is set to be disabled), would the method name then become make_person_an_outside_subscribe_if_all_access_revoked_or_user_is_set_to_disabled ?
The function as described means that the only time this method is to ever be used is if all access is revoked... if that's the case why even make it into a function? Or to put it another way:
//make_person_an_outside_subscriber_if_all_accesses_revoked
function revokeAccess(user) {
user.clearSubscriptions();
user.addSubscription(new OutsideSubscription());
//other revoky stuff goes here...
}
//shift_records_upward_starting_at
function shiftRecords(startPosition, amount) {
//up or down. to go down supply a negative amount
}
...or something