News for hackers. Stuff that matters.
Re:Poll: How many programmers don't know about bit-wise oper... by 1337Coder on Sunday April 07, 2013 @07:52AM (#5506882)
I use "&" and "|" when i use enums, that act as options. I.e. var myCarExtras = Extra.Radio | Extra.PowerWindows;

Where Extra = { Radio = 1, PowerWindows = 2, Tint = 4, Rims = 8 };

Then I can do: if (Tint | powerWindows) { return totalPrice + 1000; }

Re:Poll: How many programmers don't know about bit-wise oper... by BruceIV on Sunday April 07, 2013 @08:20AM (#5506948)
C# programmer? I think this is one of the nicer little features in that language.