Question: I've seen others use Bitwise-OR to combine flags before:

```
#define RUN 0x01
#define JUMP 0x02
#define SHOOT 0x04

const byte madPerson = RUN | JUMP | SHOOT;

```

That's also the way I do it.

But I've also seen some (not as many) combine flags using addition:

```
#define RUN 0x01
#define JUMP 0x02
#define SHOOT 0x04

const byte madPerson = RUN + JUMP + SHOOT;

```

Which one is more "readable"? (Which one do you think more people will recognize?) What is the "standard" way to do it? Which one do you prefer?

Answer: 
Bitwise-OR.
===========

Addition is dangerous.

Consider an example where a bandit is a person, and an angry bandit is a bandit that speaks and shoots. Later, you decide all bandits should shoot, but you've forgotten about the angry bandit definition and don't remove its shooting flag.

```
#define PERSON 1 << 0
#define SPEAKS 1 << 1
#define SHOOTS 1 << 2
#define INVINCIBLE 1 << 3
const byte bandit = PERSON | SHOOTS;                    // 00000101
const byte angryBandit_add = bandit + SPEAKS + SHOOTS;  // 00001011 error
const byte angryBandit_or = bandit | SPEAKS | SHOOTS;   // 00000111 ok

```

If you used `angryBandit_add` your game would now have the perplexing logic error of having angry bandits that can't shoot or be killed.

If you used `angryBandit_or` the worst you'd have is a redundant `| SHOOTS`.

**For similar reasons, bitwise NOT is safer than subtraction for removing flags.**
bitwise-OR conveys the intent more clearly

also, bitwise-OR *should* be more efficient