-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update the recommended way to reference feature flag name in README #275
Update the recommended way to reference feature flag name in README #275
Conversation
README.md
Outdated
@@ -144,12 +144,12 @@ In the above example, `FeatureW` specifies a `RequirementType` of `All`, meaning | |||
To make it easier to reference these feature flags in code, we recommend to define feature flag variables like below. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we recommend to define feature flag variables like below
I'm thinking, is it worth a recommendation? This is fairly basic definition of strings. I would imagine just removing this section would be fine.
The only issue I can think with that is that we reference MyFeatureFlags.FeatureX
and others below. Perhaps though, it's clear enough that those references should be the names of the flags.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we want to remove the recommendation, maybe we can just use string "FeatureX" instead of the reference.
If I am a user, I can understand that this is just the name of the feature flag which is a string variable.
But there is a customer who raised an issue for this. He expected us to update the recommendation.
References of |
README.md
Outdated
public const string FeatureV = "FeatureV"; | ||
} | ||
``` | ||
In the following code examples, MyFeatureFlags.FeatureX which is a const string property of the MyFeatureFlags class, is used for referencing the name of feature flag "FeatureX". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about just removing MyFeatureFlags altogether and using string literals?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. That's my original thought #275 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, sorry. Missed it.
Issue #269
Change the recommended approach to reference the feature flag names from enum to const strings.