Why feature toggles

Trunk-based development is the goal. Toggles make it possible.

Feature toggles aren't an end in themselves. They are the practical way to stop working on a branch per project — see the problem.

The answer

Trunk-based development

Everyone merges small changes into one main branch — the trunk — frequently. Branches live for hours or days, not months, so there is never a big merge to dread.

It is how large engineering organisations work: Google runs tens of thousands of developers on a single trunk. DORA's research on software delivery links it to faster, more stable delivery.

With toggles: one trunk
frequent merges deployed, switched off released
Why it needs toggles

Deploy now, release later

Merging unfinished work into the trunk is safe only if it can be deployed without going live. A feature toggle separates the two: the code is deployed switched off, and the feature is released later, at run time, when the business says go.

Without a toggle, "deploy now, release later" isn't possible, and teams drift back to a branch per release.

AI coding agents now write more code than people can review. Teams that use them keep new code behind a toggle, deployed switched off, until someone decides it is ready.

What toggles cost — and how FTF handles it

The honest part: toggles have costs of their own.

The costHow FTF handles it
Two code paths to test. While a toggle lives, the feature on and the feature off both need testing. Testers switch a toggle in their own environment and test both ways — no redeployment.
Toggles left behind become debt. One study of a large browser's release toggles found more than half outlived ten releases. In 2012 a trading firm lost $460 million in under an hour when new code reused an old flag. Every toggle is tracked from the day it's defined until it is removed everywhere, and each toggle's name carries its application and story — a new feature gets a new toggle. A toggle's life
Not every change can be toggled. Database changes, API contracts and batch schedules take effect the moment they're deployed. Those still move in small, safe steps — add the new alongside the old, move callers over, then remove the old (Martin Fowler's parallel change). Trunk-based development still works; it just isn't a toggle that makes it work.

Further reading: trunkbaseddevelopment.com · DORA: trunk-based development · Martin Fowler: feature toggles · Daniel Lopes: trunk-based development in the age of AI agents (the toggle study and the AI-agent practice).