Why are bit masks called “masks” and what purpose do they serve

bitwise-operatorsefficiencylow-levelterminology

Why are "bit masks" called like this?

I know that they are mainly used for bitwise operations and the usage of bit masks is more efficient than the usage of separate variables.

However my question is why and when were bit masks invented? Were they used since early computing? Are there any other type of "masks" besides bit masks in the IT domain?

Best Answer

A mask (of the facial variety) is something that covers up some parts of your face and lets other parts show through. The terminology is used by analogy in computing: a bitmask covers up (filters out) some bits in a bitset and allows others to pass.

Are there any other type of "masks" besides bit masks in the IT domain?

Just off the top of my head, masks are used frequently in image processing. It's a similar concept: you create a black-and-white image that shows the shape of what to mask off and what to let through.