You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: practices/feature-toggling.md
+11-1Lines changed: 11 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,7 +79,16 @@ Poorly managed toggles can lead to complexity, bugs, and technical debt. Best pr
79
79
- Guard the feature behind a single toggle check, and pass the resulting behaviour or strategy through your code to minimise duplication and simplify removal.
80
80
- Ensure toggles are discoverable, testable, and auditable.
81
81
- Avoid nesting toggles or creating toggle spaghetti.
82
-
- Remove stale toggles once their purpose is fulfilled.
82
+
- Remove stale toggles once their purpose is fulfilled. Ideally integrate this into your CI pipeline to report on stale flags.
83
+
84
+
## Caveats
85
+
86
+
Whilst there are obvious benefits to Feature Toggling, there are some caveats worth bearing in mind when implementing them
87
+
88
+
-**Performance Overhead**: Feature toggles can introduce performance overhead if they are checked frequently, especially within loops and every evaluation goes back to the server.
89
+
-**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
90
+
-**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.
91
+
-**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.
83
92
84
93
## Caveats
85
94
@@ -146,4 +155,5 @@ Best practices:
146
155
-[Feature Toggles (aka Feature Flags) by Martin Fowler](https://martinfowler.com/articles/feature-toggles.html)
147
156
-[11 principles for building and scaling feature flag systems](https://docs.getunleash.io/topics/feature-flags/feature-flag-best-practices)
148
157
-[Best practices for coding with feature flags](https://launchdarkly.com/blog/best-practices-for-coding-with-feature-flags/)
0 commit comments