little cubes

Explaining developer jargon for everyone else: “Feature flag”

A feature flag (sometimes called a feature toggle) is a switch in the code that controls whether a feature is visible to users — without changing what’s actually deployed.

When code is behind a feature flag, it’s in prod, fully released, but hidden. Users don’t see it yet. When you’re ready to launch, you flip the switch.

Think of it like moving furniture into a room under a drop cloth. The furniture is already there — it’s in the house — but nobody sees it until you pull the sheet off.

Why not just release the feature when it’s done?

Section titled: Why not just release the feature when it’s done?

Sometimes you can. But on a large project with many developers working simultaneously, it’s common to be in a situation where Feature A is ready to ship but Feature B — which was merged into the same codebase — isn’t.

Without a feature flag, your options for shipping Feature A are:

  • Wait for Feature B to also be ready (delays your release)
  • Manually remove Feature B’s code before releasing (time-consuming, error-prone, and requires another release later just for Feature B)

With a feature flag, Feature B’s code ships alongside everything else — it’s just turned off. When Feature B is ready, you flip the switch. No extra release needed.

The flag stays in the code after launch

Section titled: The flag stays in the code after launch

A feature flag isn’t just useful for hiding things before launch. It’s also a safety net after.

If you release something and it causes problems, you can turn the flag off immediately — no emergency deployment required. That’s a lot faster than trying to revert code in a crisis.

So the flag tends to stick around for a while after launch, just in case.

It’s a problem when flags don’t get cleaned up.

Once a feature has been live and stable for months, the flag is essentially useless — there’s no realistic scenario where you’d turn it off. But it’s still sitting in the code, creating a fork: two paths through the logic, one for “flag on” and one for “flag off.”

Over time, this kind of thing accumulates. Dead code paths. Logic that will never execute. Conditions that nobody remembers the purpose of.

It’s like having a puzzle box full of extra pieces from three different puzzles.