The If-Statement Retirement Plan

Somewhere in every production system there is a function nobody loves. It is four hundred lines of if-statements. It checks a deny list, then a beta flag, then a tenant tier, then a regex somebody wrote in 2019, then a country table, and then, if the stars align, it lets the request through. It is called something dignified like evaluate_policy . It is the slowest thing in the hot path and…