Live data from Hacker News

It's OK to hardcode feature flags (2025)

code.mendhak.com

51–54 of 54 posts

Re: It's OK to hardcode feature flags (2025)

#51
post #35
post #28

Earlier quoted context omitted.

I 100% agree with everything you said and more. I spent a significant amount of time at my job arguing constantly with the entire engineering department that “Feature Flags” are not all the same thing and had to push back on efforts to mix them all up. Examples: Experiment flags for A/B testing Permission checks at a user level Product flags for feature gating by plan Rollout flags to launch a new feature gradually C…

Why would you not use the same service to handle them? Less is more.

I explained: they’re all doing different things, they have different behaviours, they have different performance and uptime characteristics. The reason that the values change are completely different, so how that information is set and read will be completely different. Who sets it, who reads it.

An example: at my current job, we’re using LaunchDarkly for config management, not just rollout. This means an incident on LaunchDarkly didn’t just stop a rollout, it caused the system behaviour to change for a large number of customers as it reverted to the default.

Re: It's OK to hardcode feature flags (2025)

#52
post #50
post #37

Earlier quoted context omitted.

i could see it getting complex with a lot of flags, inevitable you'll run into a situation where more than one flag is combined. something like enabledFeature = (flag1 || flag2 || flag3) && flag4 then, down the road, you remove flag4. Hopefully the above would result in a compile error but you may be in a language or situation where a missing flag4 is interpreted as boolean false. That could cause all kinds of havoc…

Surely the commenter means deleting them in the code, not just the management software. Otherwise, what's the point? You need to find every occurrence of flag4 and remove references to it. So that boolean expression would need to have `&& flag4` removed.

What I’m saying is there may be references you don’t have access to.
Post reply on HN