3 min read

Refactoring Racist Language

Words matter. When used thoughtfully they can include an entire group of a people. They can acknowledge that a person exists, that you know their name and even how they pronounce it.

Words can be used to put people down deliberately, which obviously isn’t cool, but more dangerously, they can obstinately be retained in everyday language when we don’t consider them in the context of their usage over time. As we learn how words, phrases and sayings have been used in the past, we should all make an effort to understand if they are offensive or a painful relic of suppression, violence and injustice to a group of people or really any species.

One nice thing about being a technologist is that in addition to fixing coding errors, we can also remediate unfortunate coding decisions.

For diversity reasons, it would be nice to try to avoid “master” and “slave” terminology which can be associated to slavery. - Issue 34605

It was very to awesome to hear how the python community in 2018 removed the use of “master” and “slave” from its codebase. I remember chatting with my team aobut whether “master” would also be removed from github, but people generally thought that describing the primary source branch as master did not have same troubling connotation. Nevertheless, github was on it and is now using main as the default branch as of Octobor 1, 2020, yay!

Git on it!

Last month I took a few minutes to update this repo, github.com/aliciatb/blog following the steps outlined in this article. R-bloggers also has gReat article outlining the 5 steps to change GitHub default branch from master to main.

As I am the only publisher to this repo and don’t have any pull request nonsense to deal with, it was very easy to -

  1. Back up my repo (just in case)

I downloaded from github

  1. Create a new branch main off master

git branch -m master main

  1. Push new branch

git push -u origin main

  1. Point the HEAD to retain commits

git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main

  1. Update default branch in github

  2. And finally delete master.

git push origin --delete master

Did I just copy and paste git code from the article? Yes, yes I did! And, it just worked!

Integration Considerations

If you do have any automated things configured for your code, you will need to update the branch that triggers those actions. As this blog is completely HTML, it is hosted for free on netlify and easily configured in github to deploy upon check-in to my primary branch. After renaming master to main, I did need to point to new main branch to get that integration working again. It had also been 18 months since I initially set up the automatic deployments and discovered that I also needed to specify hugo version in netlify, found with following function.

blogdown::hugo_version()
## [1] '0.68.3'

Technology changes are easy

Updating a repo is a very easy first step towards being a more thoughtful person, developer, and citizen. It’s good to take care of the easy things, but let’s tap the brakes on declaring Mission Accomplished. The real work we need to focus on is to be thoughtful in our daily interactions in the world and persist in our insistence on a diverse universe.

Is It Enough To Remove Words With Racist Connotations From Tech Language? Hint: No