Skip to content

Commit 6bc3bc6

Browse files
Update to resolve PR comments (#353)
1 parent 1083490 commit 6bc3bc6

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

practices/feature-toggling.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- [Why use feature toggling?](#why-use-feature-toggling)
1010
- [Types of toggles](#types-of-toggles)
1111
- [Managing toggles](#managing-toggles)
12+
- [Caveats](#caveats)
1213
- [Toggling strategy](#toggling-strategy)
1314
- [Toggle lifecycle](#toggle-lifecycle)
1415
- [Best practice lifecycle](#best-practice-lifecycle)
@@ -72,10 +73,19 @@ Poorly managed toggles can lead to complexity, bugs, and technical debt. Best pr
7273
- Give toggles meaningful, consistent names.
7374
- Store toggle state in a centralised and observable system.
7475
- Document the purpose and expected lifetime of each toggle.
75-
- Remove stale toggles once their purpose is fulfilled.
76+
- Remove stale toggles once their purpose is fulfilled. Ideally integrate this into your CI pipeline to report on stale flags.
7677
- Avoid nesting toggles or creating toggle spaghetti.
7778
- Ensure toggles are discoverable, testable, and auditable.
7879

80+
## Caveats
81+
82+
Whilst there are obvious benefits to Feature Toggling, there are some caveats worth bearing in mind when implementing them
83+
84+
- **Performance Overhead**: Feature toggles can introduce performance overhead if they are checked frequently, especially within loops and every evaluation goes back to the server.
85+
- **Toggle Bloat & Technical Debt**: Toggles are intended for short term use, failure to adhere to this principle can lead to conditional sprawl of if statements, harder code to read and maintain and increased risk of toggle conflicts or becoming orphaned
86+
- **Test Complexity**: More toggles increase your permutations around a single test path. A single toggle doubles the test scenarios and needs careful factoring in to the test approach.
87+
- **Increased Logging/Observability Needs**; Now need to know the state of the toggles at the point of the logs, otherwise inspecting the logs becomes incredibly difficult.
88+
7989
## Toggling strategy
8090

8191
Choose a feature flagging approach appropriate for the scale and complexity of your system:
@@ -129,3 +139,4 @@ Best practices:
129139
- [Flagsmith Docs](https://docs.flagsmith.com/)
130140
- [Feature Flag Best Practices](https://launchdarkly.com/blog/best-practices-for-coding-with-feature-flags/)
131141
- [Thoughtworks Tech Radar](https://www.thoughtworks.com/radar/techniques/minimum-feature-toggle-solution)
142+
- [Defensive coding](https://docs.flagsmith.com/guides-and-examples/defensive-coding)

0 commit comments

Comments
 (0)