Lesson 4: Flag hygiene

We've created flags, released features, and performed experiments. Those flags have been used successfully and they're no longer needed, so now it's time to remove them.

In this lesson, you'll learn about flag hygiene: the importance of archiving flags that are no longer used and removing the code that references them. This is a vital part of the flagging process. Without it, your code will end up cluttered with old chunks of logic that are no longer executed.

The process of cleaning up expired flags and code usually follows these steps:

  1. Identify flags to be removed
  2. Remove flag references from code
  3. Remove flags from the flag list

LaunchDarkly has tools to manage all three steps. Let's start with the first of those: identifying flags to be cleaned up.