In a tip earlier this week, I talked about some benefits from limiting the number of feature flag checks throughout your app. Other than just general code cleanliness or worrying about the performance of feature flag lookups, there's another reason I think this is important.
Feature flags are meant to be temporary.
It's a tool to help you control release of a feature, but once the feature is released, it has served its purpose and can be removed.
By limiting the extent to which we spread feature flag logic throughout our app, we are ultimately also making it easier to clean them up later.
And even better, if your feature flag names are defined in an enum, you don't have to go hunting for strings. Your editor can show you all the places a particular enum value is used, making it much easier to remove them.
Here to help,
Joel
P.S. Beyond Code makes some very useful tools for Laravel developers. And if you purchase with our link, they help support this site.