5 Feature Flag Best Practices
As dev teams continue to improve agility, the tools and approaches for building and delivering software are making headway. In this mad scramble, DevOps and CI/CD practices assume the role of a solid basis for releasing software with boosted automation and decreased risk. And one of the sure-fire ways to guarantee that everything that a customer faces is not subject to catastrophe is to leverage feature flagging.
With that said, let's give you a low-down on top practices for this part of the software development process.
Less Is More
Here is the thing. Feature flagging is a lifesaver that can support many novel workflows useful to the modern methodologies. However, going overboard with this practice can have the opposite effect. An excessive number of feature toggles means that there is a growing number of code paths. As a result, you end up with increased code complexity and complicated testing. To avoid that, turn to this practice only when it seems logical and always repurpose the existing features if possible.
A Feature Flag Whose Job Is Done Should Sink Into Oblivion
Feature toggling lets you deploy code fast and with the least disruption. But when your experiment comes to an end, it’s time to wipe the slate clean to avoid further chaos. Otherwise, you face the risk of introducing the false feature to the audience. You can consider setting expiration dates for your feature toggles to cut through all that.
Know Your Enemy By Name
Technically, feature toggles are your best friends, but naming them still helps. To navigate the ocean of feature switches, it is important to give them a nomenclature. Without labeling them, it is easy to get lost. Most likely, you will forget about their designated use or use the same name another dozen times. And none of this will give you a leg up.
Therefore, make sure to have a unified tagging system for better control and team communication.
Use a Feature Toggle Management Tool
Having a solid, easy-to-use platform helps to safely test features in production. You may think you are better off with a simple page of on-and-off checkboxes. But it gets trickier with the increasing number of features with a variety of statuses. Feature toggle management tools, on the other hand, account for better command of the application when you scale it.
LaunchDarkly is your go-to management tool that goes even beyond feature flagging. Along with ease of management and increased development rate, LaunchDarkly uses a real-time streaming connection to ensure fast and secure delivery.
Use Feature Toggles For Experimenting
Finally, feature switches empower software engineers with tools to roll out new features to particular audiences. Thus, instead of reading the tea leaves, you can just show the new functionality to the users and gauge their reaction.
Imagine integrating a “get started” CTA button with different graphics, button styles, and font to see which one generates more clicks. Feature flags let you demonstrate the new functions to a narrow target audience and fetch valuable insights. You can then use those insights to course-correct the development and fine-tune the feature to users' preferences. That’s how giant companies test the waters before rolling out a new update.
Summing up, feature toggle is a powerful technique that makes development faster and safer. Also, it’s your workaround way to deploy a new feature into production without turning it on until you’re ready. Make sure to use it wisely and implement the time-tested practices mentioned above.
***
"Join our writing contest and get a chance to win cool prizes".
***
Got a tech story to share with our readers? Everything you've ever wanted to know about how to get published on Hacker Noon - get it here.