Skip to content

Commit a29dbc7

Browse files
committed
More content
1 parent 1e5d03f commit a29dbc7

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

practices/feature-toggling.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,16 @@ Poorly managed toggles can lead to complexity, bugs, and technical debt. Best pr
7979
- Guard the feature behind a single toggle check, and pass the resulting behaviour or strategy through your code to minimise duplication and simplify removal.
8080
- Ensure toggles are discoverable, testable, and auditable.
8181
- 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.
8392

8493
## Caveats
8594

@@ -146,4 +155,5 @@ Best practices:
146155
- [Feature Toggles (aka Feature Flags) by Martin Fowler](https://martinfowler.com/articles/feature-toggles.html)
147156
- [11 principles for building and scaling feature flag systems](https://docs.getunleash.io/topics/feature-flags/feature-flag-best-practices)
148157
- [Best practices for coding with feature flags](https://launchdarkly.com/blog/best-practices-for-coding-with-feature-flags/)
158+
- [Defensive coding](https://docs.flagsmith.com/guides-and-examples/defensive-coding)
149159
- [An example tool for feature toggling](https://docs.flagsmith.com/)

0 commit comments

Comments
 (0)