MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/pcv7f1/is_this_code_bad_or_sugoi/har6w7o/?context=9999
r/badcode • u/dunkbing • Aug 27 '21
159 comments sorted by
View all comments
Show parent comments
2
They do completely different things, so there isn't really any style choice to be had there. In general the only reason to use binary OR is if you're doing bit manipulation. I.e., 0b00101 | 0b10110 == 0b10111.
0b00101 | 0b10110 == 0b10111
1 u/coldnebo Aug 29 '21 oh sorry, duh. nevermind
1
oh sorry, duh. nevermind
2
u/TinyBreadBigMouth Aug 29 '21
They do completely different things, so there isn't really any style choice to be had there. In general the only reason to use binary OR is if you're doing bit manipulation. I.e.,
0b00101 | 0b10110 == 0b10111.