create(entity, bool_a)
we have a function that creates an entity and take a bool flag, and it has 2 possible variants (entity + true, entity + false). If we add another bool flag create(entity, bool_a, bool_b)
then it increases to 4 states. Add another and you're dealing with 8 states, and so on and so forth. We likely don't care about all 8 states - rather 4 or 5, but complexity increases.In this case, with the type key, we're essentially dealing with a sum type that has two variants
(admin, attributes) | (customer, attributes)
which is fairly clear. if we add another variant to it, we only increase by one (admin, attributes) | (customer, attributes) | (distributor, attributes)