Feature flags let a team deploy continuously while releasing deliberately, which removes most of the risk from shipping. They are one of the highest-value practices available.

They are also, quietly, conditional branches that double the number of paths through the code, and they are added far more often than they are removed.

Each flag multiplies the states

Twenty live flags describe over a million combinations. Your tests cover a handful, and the combination a specific customer is running may never have been executed anywhere else.

This is how a system with good test coverage still produces failures that nobody can reproduce.

Distinguish the kinds

Release flags exist to ship a feature gradually and should be removed within weeks. Operational flags — kill switches, load-shedding controls — are meant to be permanent. Experiment flags end when the experiment does. Permission flags are really entitlements and belong in the authorisation model.

Treating all four as one category is why the temporary ones never get cleaned up.

Give temporary flags an owner and a date

Record who added each flag, why, and when it is expected to be removed. Report on flags past their date, and treat removal as part of the feature rather than as optional cleanup.

A feature is not finished when it is enabled; it is finished when the flag is gone.

Test both sides, briefly

While a flag is live, both paths are production code and both need coverage. This is a real cost and it is a further argument for removing flags promptly rather than leaving them indefinitely.

Use flags freely and remove them ruthlessly. The value is in the transition, not in the permanent option, and the ones that overstay are the ones that cause the outages nobody can explain.

Written by the Global IT Solutions engineering team. Have a project this touches on?

Start a conversation