Latest Post

The Basics of Poker How to Use Toggle Properly


A toggle is a switch that has two states: on and off. We see this in hardware — the Caps Lock and Num Lock keys on your keyboard are toggles — but it’s also common in software. We see it in options menus, for example, where you can select whether to hide or display certain items. It’s the same concept as a light switch that turns on and off or the on-off button in an electrical circuit.

Applying feature toggles to your development process supports newer agile approaches and allows you to release features even while your team is writing them. Normally, they would write those features on code branches in a traditional waterfall model and then need to merge them back into trunk before they could go live. But with toggles, they can push them to production as soon as the devs finish writing them — and then continue to work on the rest of the application without breaking anything else.

Feature toggles are great for experimentation because you can test how well new functionality will be received with a subset of your audience before rolling it out to all users. Then, if you’re convinced it’s ready for prime time, you can simply flip the toggle to its “on” state and then your feature will be available to all your users.

It’s important to be careful using feature toggles, because if you use too many of them it can result in a lot of if-else logic and violate all sorts of clean code principles. It’s also best to name your toggles well so that anyone on your team can quickly figure out who wrote it, when it was written, and what it does.