What is a Togle?

April 26, 2024 by No Comments

A toggle is a control that only has two outcomes (ON or OFF). Toggles are best for setting system settings and preferences rather than specific behaviors. They are the preferred control on mobile devices over radio buttons, for example. The toggle switch should always display the current state and be labeled to make it clear what action will be taken if the switch is changed.

Feature Toggles are used to enable features that aren’t ready for production release or to disable a feature that has been causing problems. Feature Toggles can be configured with a wide range of rules from simple “if-then” statements to complex decision trees which act upon a variety of variables including fitness test results, settings in a feature management system or even a variable provided by a config file.

Experiment Toggles are used to perform A/B testing by dividing a cohort of users into different groups and sending them down one codepath or another. This allows us to determine which of two or more potential solutions has the most positive impact on our customers and then move it into production.

Some teams consider whether to create a toggle around a bug fix in order to avoid accidentally worsening the issue with a patch. However, creating a toggle for every bugfix can cause a feature backlog to quickly grow out of control and it’s often wiser to decide case by case. Savvy teams understand that feature toggles come with a carrying cost and try to keep their inventory low by removing them as soon as they are no longer needed. To this end some teams have a rule of adding a task to the backlog for toggle removal as soon as they are first introduced and others put “expiration dates” on their toggles.