top | item 10498204

Feature Flag-Driven Development

15 points| mikojava | 10 years ago |blog.launchdarkly.com | reply

13 comments

order
[+] nobullet|10 years ago|reply
The problem with FFDD is the code, full of "if"s. Some branches stay dead for months and years. When a feature is released, the flags need to be deleted and this becomes a challenging and boring task. Teams usually postpone these removals, setting the lowest priority. In my opinion, Module Flag-Driven Development gives much better results. Management agrees which set of features is released in a group as a module. Instead of "if" or "ifdef" engineers have a configuration of enabled modules. There is no need to delete a flag.
[+] jkodumal|10 years ago|reply
I haven't heard of module flag-driven development-- would love to hear more details.

We manage the cleanup issue by defining a "removal branch" that cleans up the feature flag at the same time the feature flag is introduced. This sticks around as a dormant pull request during the lifetime of the flag. It's not much overhead when this is done early. Cleanup does become painful when the code's not fresh in your mind.

Note that we do feature branches as well as feature flags-- trunk vs. branch based development is orthogonal to using feature flags.

[+] edabobojr|10 years ago|reply
One question/concern I have always had -- Do you have multiple feature flags in place at once? How do you avoid the combinatoric increase in possible configurations? If you have feature A and B, what happens if A is turned on first? If B is turned on first? What if they are both turned on at the same time?
[+] jkodumal|10 years ago|reply
We do have multiple feature flags in place at once. Our dogfood server (we use LaunchDarkly on LaunchDarkly) has about 30 feature flags going at any given time, and we're a relatively small team (still one standup).

For the most part, flags are independent. When I first started using DVCS (back in the Bitkeeper days) we all thought that merge conflicts from doing feature branching would be a headache, but this didn't end up being the case. I've found the same with feature flags. While it's possible for flags to interact poorly, or to introduce "dependent" or nested flags, it hasn't been a problem for us in practice.

This seems to scale, too-- I haven't heard this to be an issue in practice at larger orgs (Etsy, Netflix, etc.) that do feature flag-driven development.

[+] Tiquor|10 years ago|reply
I like how one of the oldest concepts in programming, the ifdef, has now become (if you read the press) a "revolutionary idea" created by Facebook and apparently the core of a company's business. I'm only being a little sarcastic.
[+] arielweisberg|10 years ago|reply
Being able to merge in progress development to your main branch is an important part of reducing product in development and reducing cycle time. When dealing with big features that aren't going to reach a viable end user visible state for months to years it can be a real challenge especially when what your are working on feels like a it "touches everything."

This is more than just the technical capability. I've been on teams that insist they are completely unable to iteratively develop and deliver big features. As a result you end up with huge impossible to review patch drops at the ends of months of work behind closed doors. It's a disaster every time.

I'm still struggling to communicate to people how to do it and what the benefits are.

[+] jkodumal|10 years ago|reply
CTO of LaunchDarkly here. We kind of embrace it a little bit-- locavore booleans as a service.

But the real power behind the idea is not the ifdef piece, it's the idea of dynamic, context-aware configuration. You've got a user-friendly tool that can control the code paths being executed in your application without restarts or redeploys.

[+] tedmiston|10 years ago|reply
I would try it if you had a free tier for testing in dev.