Andy McKay

Jan 07, 2015

Language is important


This last week I sent in a pair of pull requests to remove the terms whitelist and blacklist from a couple of our repositories. You might scoff a such a pull request and a while back I would probably have been one of the first to question such a pull request, but my views on this have been changing.

Personally, several things came up recently. I play Dominion with my two daughters and wife. All the cards in Dominion refer to male players. He and him throughout. Apparently they were gender neutral at the beginning and Rio Grande Games changed them to be male. Now they just annoy me.

A colleague of mine, the awesome Chris Karlof, writes all his use cases, bugs and documentation defaulting to a female perspective. Throughout the use cases it refers to actions she takes. Then earlier in 2014 there were multiple pull requests in Django and other projects that tackled these terms and gender bias.

Lastly, I support the Washington Redskins (go RG III), have done for many years. But I wish they’d change their name (and get a new owner), I’ve met enough people now who are offended by it.

Finally, I decided it was time to make some changes and started making small changes to our code bases. First off I commented on a few pull requests that there might be better terms for whitelist. Then I started changing our code bases. Interestingly enough on the way, I realised I was the person who had introduced those terms in a few places.

When you think about it there are probably better terms. For example: email_whitelist became emails_allowed, tag_blacklist became tags_blocked. In pretty much every case there is a better word that is: 1) more descriptive and 2) shorter. That’s a win.

You could use things like allowlist or denylist, but unless you are particularly fond of Hungarian notation why have list in there at all? Just use a variable that reads well.

Will this make a big difference?

Of course not, I’m not pretending it will. I can’t point to studies or anything proving offence. But I can look at my code base with a little bit more pride and think that it sets a decent example.

Where does it end?

I can’t predict what’s offensive in every culture and every person in the future. Using that as an excuse to not make the change is lame. I’m just a simple person trying to do something right. Certainly something new will come up and we’ll adapt when it happens. We’ll be listening and that’s important.

Haven't we got better things to do?

Yep, we all do. But if you’ve got 5 minutes or see something that might be offensive, clean it up. It’s easy to always play the “too busy” card and never fix things.

So if you see something you could make a little better as you make changes, just give it a go. If you are feeling brave you could tackle this or this.

At Mozilla, I’m recognizing that we have a diverse multi-cultural team and inclusive team. I’m proud of that and want to support it. After all: Doing good is part of our code. Literally.