What Is a Toggle?

Togle

A toggle is a switch that has two positions: on or off. The switch may be physical or virtual. In software it is commonly used to activate functionality that would otherwise be inactive, for example by switching on a menu item or enabling an API call. In our experience, the most effective toggles combine an obvious visual cue with a more subtle one. For example, embossment is a great way to emphasize the active state of a button, but combining it with a color-fill also performs well.

Feature toggles are useful in software because they provide an easy way to roll out/back features during code deployment and shorten the cycle time for testing. This helps teams meet their delivery targets and respond to high latency periods.

Savvy teams view their inventory of feature toggles as an overhead that comes with a cost and they strive to keep it low. This includes implementing a process for vetting whether toggles are the appropriate method for solving a problem. They also don’t let old toggles hang around in their code, pruning them as soon as they have run their lifecycle. This is accomplished through adding a toggle removal task to the team backlog or building the process into their management platform.

Toggle removal becomes even more important when using runtime configuration (e.g. via an endpoint) to manage a toggle’s state. To avoid having to restart an application or manually re-deploy an artifact just to flip a toggle to the “On” position many teams choose to incorporate an expiration date into their feature flags.