I have to admit that, as someone who has worked seriously in IT for over a decade (and in any capacity for more than twenty years), I had used the word "mask" fewer times than our clients have over the last few months. That is odd, because the term is certainly used in systems, programming and computing in general, and it has a fairly specific meaning. Yet I have heard it in contexts I never dreamed of. I do not mean this as a jab. I find it fascinating that different industries have words that describe different, seemingly similar but still distinct phenomena, and where fields overlap you get an ambiguity that is satisfying to untangle, because it also tells you about the experience of the people in the discussion. Phew, I haven't written a sentence that long in a while.

Still, there is no denying that when I heard people mention a mask here and there, I did not always know right away what the other person meant. But as I wrote above, as I learned the context and the environment my interlocutor worked in, I found out more not only about what the word meant in that case, but also about what the users had worked with so far. And that is often very important information when setting nonfunctional requirements and shaping the overall vision of a software's features.

I decided to collect the meanings of "mask" and describe them briefly. Some are more "formal" and are definitely talked about in computing, while I met others in specific cases, and we can wonder together where they came from.

Mask as a subnet definition

What most IT people associate with the word "mask" is computer networking, or more precisely, a sequence of numbers (or a number) that defines how a network address is split into a subnet address and a host address. Before you start wondering what you just read, I suggest doing two things. First, refresh your knowledge of IP addresses. Second, open a console (Command Prompt on Windows or a terminal on Linux) and type ipconfig, ip a or ifconfig. You should see something like one of these outputs:

IPv4 Address. . . . . . . . . . . : 192.168.0.16
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.0.1
--
inet 192.168.0.16 netmask 255.255.255.0 broadcast 192.168.0.255
--
inet 192.168.0.16/24 brd 192.168.0.255

If you now compare this with the article on IP addresses and its section on dividing a network into subnets, you have just found the place where you can read:

  • what your IP address is on the local network,
  • what the mask is (written normally, e.g. 255.255.255.0, or in CIDR notation, e.g. /24),
  • what the broadcast address is.

To put it more vividly: the mask marks the boundary where the base address for the whole network (say, a building) ends and the part unique to each machine on the network begins. Think of the building number (the network address) and the apartments (the addresses of individual hosts, also called clients). The longer the mask, the fewer client addresses are available to hand out. The shorter it is, the more general the address and the more clients can connect. This is related to so-called network classes. CIDR notation, which uses a slash, shows the number of "ones" in the normal notation. From the binary form we know that 255.255.255.0 is really 3 groups of eight ones followed by 8 zeros. So how many ones do we have in total? Exactly: 3 * 8 = 24. Of course, a mask written this way does not have to be a multiple of eight, although it often is.

As you can probably guess, conversations about such masks usually happen among administrators or when configuring a large company network, provided the client is (or wants to be) aware of the infrastructure details. In conversations about an application, I think mentioning this meaning of the word would come as a big surprise.

Mask as a set of enabled bits

If we look at the subnet section above in a more "philosophical" way, we can see the meaning of the word "mask": just as a mask normally covers the face and shows what we want, in networks it hides one part to highlight the other. In reality this means laying addresses of the same number of binary digits over each other and comparing where ones cover zeros or where the digits in both addresses match. These fairly simple operations are used not only for subnets but sometimes also, for example, for checking permissions.

Imagine a string of bits, each corresponding to one of a user's abilities in a system:

  • the first bit (counting from the left): the ability to view the list of products.
  • the second bit: the ability to create a product.
  • the third bit: the ability to edit a product.
  • the fourth bit: the ability to delete a product.

Suppose a bitmask with the value 1100(2) is fetched for the logged-in user. To display the product list, the system compares it with the sequence 1000(2), or more precisely, performs a bitwise AND. In this case the result is 1000(2), which means the user may view the list. But if we checked the ability to delete (0001(2)), the result would be negative, because there are no shared ones at the checked positions.

Of course, this example is rather naive and artificial, but the fact remains that this way of checking permissions, roles and other things is still present in applications and takes advantage of how fast bit operations are. The downside is that with a very large number of items to verify, the string can get extremely long, which causes problems with storing and processing it. Still, it is worth knowing about, especially when analyzing programs built by other companies.

Mask as an input format

Let's go further with the idea of a mask as something that covers part of the data and shows only what we want shown. Frontend developers of web applications use data masking in some controls to nudge or even force the user to enter a value in a particular way. A classic example is a phone number control, since a phone number has a fairly fixed shape: first the country code, then digits grouped in threes or twos. Another example is a control for entering a date in day.month.year format. This also makes validation easier for developers, who know more or less what to expect from the user (although I have to admit that users can be very creative).

There is another kind of masking in web controls, namely hiding typed characters by replacing them with another, fixed character. We all know this behavior well: it is the password field, where what you type is immediately replaced with asterisks, dots or other symbols so nobody can peek at it. And not just peek: copying text entered this way will not let you paste it elsewhere either.

But it is not only web applications. In other uses too we can talk about formatting entered data or encoding a place where a string of characters following a given rule may appear. A classic example is regular expressions, especially in file paths. Incidentally, regular expressions deserve an article of their own, because their use in computing is invaluable.

Mask as a layer element in graphics

At this point the graphic designers may speak up, since they know masking too. It again means marking an area, but this time to give it a particular color or effect. Interestingly, masks are used for the famous operations of erasing people or objects from photos or swapping out elements of the surroundings. They can be edited and used for all kinds of operations, depending on what the graphics program allows and on the designer's imagination.

Mask as a details screen

A very interesting case was the term "client mask" that I heard during a conversation about an IT project. I admit that for a while I did not know what it meant. Knowing the whole context of the conversation (much larger than what I describe here), I first suspected a bitmask attached to the client object, but it was hard to imagine it being visible in the user interface, and that was exactly what the conversation was about. In the end it turned out that "mask" in this case was nothing more than a details screen.

In general, views like this get names that depend heavily on the environment the project owner works in and the programs they have used so far. Some really do say "details screen". Others will say "details". Still others (especially in the medical industry) say "card" or "file". Some will simply say "view", and if they add nothing else, you can assume they mean the screen showing the data of a single object. English also allows some freedom here, since both "details" and "view" are in use.

"Mask" is an interesting term in this area, though, because it suggests that the data of, say, a client (or any other object) covers some information or overlaps with it, for example depending on permissions. Still, it is a very strange word and probably comes from the specific terminology of the program the project owner used.

Under the hood

Finally, a phrase we programmers use very often. Imagine you have to explain to a non-technical person that the estimate for a new feature is very high while the user interface will be surprisingly modest. The client may rightly ask where so many hours went when they cannot see the results, or so it seems to them. The answer might be, for example, complex logic on the backend, but that phrasing can be unfortunate when you are talking to someone without technical knowledge who is also negotiating the price.

In this case it is worth using an automotive analogy. A problem with a car may be visible on the outside, but it may also concern the engine, where we usually say "under the hood". So it is a way of describing something that happens beyond the ordinary viewer's line of sight, and that is exactly how the backend works. The user usually has no access to that part of the system and cannot see what is in there, so they may not quite be able to picture it, which in turn breeds frustration. That is why "under the hood" is universal enough that it is worth using. If it is justified, of course.

Summary

I hope I managed to surprise you with at least one meaning of this word in IT, and I am sure some of you will know yet another context for it. It shows how broad a field IT has become and how new terminology is born independently in many places.

Best regards and thank you, Jakub Rojek.