Skip to main content
formatting; grammar. Focused question on singular alternative instead of polling for alternatives.
Source Link
user53019
user53019

What are some alternativesis an alternative to bitwise flags?

I was trying to be smart and elegant, and I ended up shooting myself in the foot by coding my entire application to use flags to store various combinations of settings. 

Now, I have hit a point where I have > 64 options, and I. I need to move away from flags (oror I will be forced to create additional fields, which canwill make my application really messy given its current state). Are there any alternatives

What should I consider as an alternative to using flags other than creating a separate boolean variable for each option?

Update

By flags, I mean bitwise flags, e.g.:

[Flags] public enum Time { None = 0 Flag1 = 1, Flag2 = 2, Flag3 = 4, // ... Flag63 = ... } 

What are some alternatives to bitwise flags?

I was trying to be smart and elegant, and I ended up shooting myself in the foot by coding my entire application to use flags to store various combinations of settings. Now, I hit a point where I have > 64 options, and I need to move away from flags (or be forced to create additional fields, which can make my application really messy given its current state). Are there any alternatives to flags other than creating a separate boolean variable for each option?

Update

By flags, I mean bitwise flags, e.g.:

[Flags] public enum Time { None = 0 Flag1 = 1, Flag2 = 2, Flag3 = 4, // ... Flag63 = ... } 

What is an alternative to bitwise flags?

I was trying to be smart and elegant, and I ended up shooting myself in the foot by coding my entire application to use flags to store various combinations of settings. 

Now, I have hit a point where I have > 64 options. I need to move away from flags or I will be forced to create additional fields, which will make my application really messy given its current state.

What should I consider as an alternative to using flags other than creating a separate boolean variable for each option?

Update

By flags, I mean bitwise flags, e.g.:

[Flags] public enum Time { None = 0 Flag1 = 1, Flag2 = 2, Flag3 = 4, // ... Flag63 = ... } 
added 222 characters in body
Source Link
arao6
  • 243
  • 3
  • 6

What are some alternatives to bitwise flags?

I was trying to be smart and elegant, and I ended up shooting myself in the foot by coding my entire application to use flags to store various combinations of settings. Now, I hit a point where I have > 64 options, and I need to move away from flags (or be forced to create additional fields, which can make my application really messy given its current state). Are there any alternatives to flags other than creating a separate boolean variable for each option?

Update

By flags, I mean bitwise flags, e.g.:

[Flags] public enum Time { None = 0 Flag1 = 1, Flag2 = 2, Flag3 = 4, // ... Flag63 = ... } 

What are some alternatives to flags?

I was trying to be smart and elegant, and I ended up shooting myself in the foot by coding my entire application to use flags to store various combinations of settings. Now, I hit a point where I have > 64 options, and I need to move away from flags (or be forced to create additional fields, which can make my application really messy given its current state). Are there any alternatives to flags other than creating a separate boolean variable for each option?

What are some alternatives to bitwise flags?

I was trying to be smart and elegant, and I ended up shooting myself in the foot by coding my entire application to use flags to store various combinations of settings. Now, I hit a point where I have > 64 options, and I need to move away from flags (or be forced to create additional fields, which can make my application really messy given its current state). Are there any alternatives to flags other than creating a separate boolean variable for each option?

Update

By flags, I mean bitwise flags, e.g.:

[Flags] public enum Time { None = 0 Flag1 = 1, Flag2 = 2, Flag3 = 4, // ... Flag63 = ... } 
Source Link
arao6
  • 243
  • 3
  • 6
Loading