|
9 | 9 | - [Why use feature toggling?](#why-use-feature-toggling) |
10 | 10 | - [Types of toggles](#types-of-toggles) |
11 | 11 | - [Managing toggles](#managing-toggles) |
| 12 | + - [Caveats](#caveats) |
12 | 13 | - [Toggling strategy](#toggling-strategy) |
13 | 14 | - [Toggle lifecycle](#toggle-lifecycle) |
14 | 15 | - [Best practice lifecycle](#best-practice-lifecycle) |
@@ -72,10 +73,19 @@ Poorly managed toggles can lead to complexity, bugs, and technical debt. Best pr |
72 | 73 | - Give toggles meaningful, consistent names. |
73 | 74 | - Store toggle state in a centralised and observable system. |
74 | 75 | - 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. |
76 | 77 | - Avoid nesting toggles or creating toggle spaghetti. |
77 | 78 | - Ensure toggles are discoverable, testable, and auditable. |
78 | 79 |
|
| 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 | + |
79 | 89 | ## Toggling strategy |
80 | 90 |
|
81 | 91 | Choose a feature flagging approach appropriate for the scale and complexity of your system: |
@@ -129,3 +139,4 @@ Best practices: |
129 | 139 | - [Flagsmith Docs](https://docs.flagsmith.com/) |
130 | 140 | - [Feature Flag Best Practices](https://launchdarkly.com/blog/best-practices-for-coding-with-feature-flags/) |
131 | 141 | - [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