Reading / Feature flags

Code present, feature available

Putting code into an application and making a feature available to its users can be two separate decisions.

A decision inside the program

A feature flag is a condition that software evaluates to decide whether particular behavior should be available. It can allow a feature to be enabled or disabled through configuration rather than through another code deployment. Some flags apply broadly; others follow defined targeting rules.

This creates more possible states to understand. The application contains the relevant code, but its behavior also depends on how a flag evaluates. Clear descriptions should explain both the enabled behavior and the alternative.

Hypothetical example · An alternate preview

Imagine a document viewer with an optional compact preview. With a flag enabled, it shows the compact arrangement. With the flag disabled, it uses the existing preview. A useful discussion would consider both views, what happens if the configuration cannot be read, and whether a visitor can still understand the document. This is an invented scenario, not a feature on offer.

Feature conditionEnabled behaviorAlternative behavior

Account for the extra state

Flags can help separate release decisions from deployment decisions, but they add conditions that need to stay understandable. A temporary flag can outlive its purpose if nobody revisits it. When exploring the idea, ask what the flag controls, what the fallback means, and when the extra choice should disappear. A flag is also not a substitute for enforcing access to protected information.

Further reading: Microsoft’s feature management overview.