It's even okay to hardcode them into code (not a config/json file). Depending on the build pipeline this is similar to preprocessor flags, and the code will be removed during build. It might be enough to test new features with a limited audience (beta build, test deployments for stakeholders/qa). If done correctly this solution can be easily extended to use a feature flag management tool, or a config file. PS: removi…
> It's even okay to hardcode them into code (not a config/json file). Yes, as I understood it that was what the article was all about.
It's OK to hardcode feature flags
101–110 of 111 posts
Re: It's OK to hardcode feature flags
#102Earlier quoted context omitted.
> It's even okay to hardcode them into code (not a config/json file). Yes, as I understood it that was what the article was all about.
The article suggests to put them into a config file, and considers it hardcoding. That’s how I understood it at least.
(Sheesh, WTF is that guy talking about??? Now not only "feature flag" doesn't mean anything any more, but "hardcoded" doesn't either!)
Re: It's OK to hardcode feature flags
#103Earlier quoted context omitted.
Ah that’s a super nice feature. I’m mostly familiar with AWS who don’t have a neat way of doing this, you end up with a bespoke solution either with lambdas pushing to shared volumes or just polling s3 for updates.
AWS has a native service for this called AppConfig and has agents that can pull and cache flag values so your services only need to make localhost requests.
Re: It's OK to hardcode feature flags
#104Hard-coded feature flags are more commonly referred to as configuration. The primary purpose of feature flags is to provide a way to change system behavior dynamically, without needing a deploy.
> The primary purpose of feature flags is to provide a way to change system behavior dynamically, without needing a deploy. That's not feature flags; it's just ordinary configuration. (Actually, seems many contributions to this discussion get those mixed up. Maybe even TFA itself.)
Re: It's OK to hardcode feature flags
#105Earlier quoted context omitted.
AWS has a native service for this called AppConfig and has agents that can pull and cache flag values so your services only need to make localhost requests.
AH nice, I was not aware of this. Thanks (It is expensive, though...)
$0.0000002 per configuration request
Re: It's OK to hardcode feature flags
#106Earlier quoted context omitted.
AH nice, I was not aware of this. Thanks (It is expensive, though...)
Expensive?? Really? One of the cheapest services around. $0.0000002 per configuration request
Re: It's OK to hardcode feature flags
#107Earlier quoted context omitted.
> The primary purpose of feature flags is to provide a way to change system behavior dynamically, without needing a deploy. That's not feature flags; it's just ordinary configuration. (Actually, seems many contributions to this discussion get those mixed up. Maybe even TFA itself.)
Ordinary configuration is updated via deployment. Feature flags are updated without deployment. This is the fundamental difference.
Just plain "configuration", though, is how the user sets up their software to work. That's saved in a local configuration file (or the Windows Registry or wherever) under the user's control, and doesn't require any deployment by the developer at all.
Ihan oikeasti, nykynuoriso...
Re: It's OK to hardcode feature flags
#108As a solo dev, something lightweight and cost-effective like this is attractive. Deployment is a CLI command or PR merge away.
Would I recommend it for the 200 person engineering org that deploys at most once a week? Probably not.
Re: It's OK to hardcode feature flags
#109Re: It's OK to hardcode feature flags
#110Earlier quoted context omitted.
Seriously. This is one of those cases where rolling your own really does make sense. Flags in a DB table, flags in a json file, all super simple to build and maintain, and 100x faster and more reliable than making the critical paths of your application's request cycle depend on an external provider.
We did this. Two tables. One for feature flags, with name, desc, id, enum (none, defaultToEnabled, overrideToDisabled). One for user flag overrides, with flagId, userId, enum (enabled, disabled). The combination of these two has been all we've ever needed. User segmentation, A/B testing, pilot soft launch etc are all easy.