Skip to main content

You should know when to remove a feature flag

In yesterday's email, I mentioned my recent "minimum viable feature flag" tweet and that I think feature flags should be short-lived.

But how do you know when a feature flag should be removed?

My approach is to add a TODO comment above where I use a feature flag.

In that comment, I added why the feature flag was added and when it can be removed.

It can be something like "Remove this when x is deployed" and/or a targeted date when I'd expect to be able to remove the flag.

Then, when reading through the code, anyone can see when it should be possible to remove each feature flag, and it's easy to find flags that can be removed by reviewing the TODO comments.

Was this interesting?

Subscribe to my daily newsletter for software professionals on software development and delivery, Drupal, DevOps, community, and open-source.

About me

Picture of Oliver

I'm a certified Drupal Triple Expert and former Drupal Association staff member with 18 years of experience, a Drupal core contributor, public speaker, live streamer, and host of the Beyond Blocks podcast.