The nightmare that is filenames

The nightmare that is filenames


Most of my students have nightmares about exams or deadlines they fear to miss. I have nightmares about filenames. It is such a simple thing, but it is really tough to get them right so that they work for and not against you. This is especially true when working on a project with other people and everyone wants to use their own naming conventions. Please wake me up!

On a more serious note, if you look through your digital folders and find files called data.xls, interviews.docx, thesis.docx, then this post will give you some inspiration to improve your filenaming in just three simple steps. Apart from that, it will make working with your digital files a lot more pleasant. Let me show you how by considering the problem at hand.

We all have those manuscript files with such indicative names

Figure 1: We all have those manuscript files with such indicative names

The problem with filenames

Nightmare-inducing filenames come in different shapes and colours, but they often share some common patterns:

  1. Filenames are not very informative but repetitive,
  2. There is a lack of consistency in naming documents, and
  3. There is no redundancy for essential documents.

A usual challenge with working on documents is that they can get updated regularly. Thus, at some point, you might have many different versions of the same file unless you shamelessly save under the same filename every time. While all this works well at that moment, once you step away from a project for a week, you suddenly cannot remember which file is the one you should continue working with. Admittedly, you can look at your file’s last changed metadata. However, this takes extra time because you have to look it up. What if you could have files in automatic chronological order with built-in versioning? There is no need to use and learn about fancy versioning plugins or platforms like GitHub (although they are pretty handy). The following presents three main guidelines I follow when naming my own files. Best of all, it works well when collaborating with others too.

1. Choose filenames that reflect the content accurately and uniquely

No filename should ever be the same. This might sound easier than it is. Files like data.xls can be easily found on almost every computer of my students. However, if you have multiple files named the same, it quickly becomes challenging to distinguish them. Also, any search tools you might use to find files will yield several documents with the same name, but each file belongs to a different assignment, project, or dataset. Thus, you need to open them first to know which one is which. Overall, it is just a bit of a mess, especially when you are in a hurry. Of course, there is nothing wrong with having a bit of a mess (I guess), but if you sometimes get frustrated by such things (like me), then you might want to look for a better way to handle your files.

When all files are named the same, search tools become rather useless

Figure 2: When all files are named the same, search tools become rather useless

There are simple ways to make filenames unique, such as:

  • Add the project name,
  • Add a date,
  • Add the name/pseudonym of a research participant,
  • Add a versioning number,
  • Etc.

Whatever it is, make sure that someone else who looks at the filename could make sense of its content without needing a full-fletched introduction to it. If someone else can understand it, you can too. So keep it simple but also informative. Practice makes perfect. At the same time, do not waste hours on trying to find the perfect name for your file.

2. Always lower-case filenames with no space

I might sound like a broken record, but consistency is key. To keep everything as manageable as possible, I usually remove any variation (i.e. ambiguity) from my ‘file naming equation’. Thus, there is typically no mixing of lower and upper-case letters, and I never use a space or any other special characters between words. Instead, I prefer either a - or _ to separate keywords in the filename. Figure 3 provides some examples.

The same files as in Figure 2 but with unique file names

Figure 3: The same files as in Figure 2 but with unique file names

This idea of using no spaces and lower-case letters stems from the good old times when operating systems could not handle special characters in filenames. While it is not so much of a problem these days (for most software), it still has its merits regarding consistency and cross-platform compatibility. It is simple and easy to remember.

As a consequence of religiously following this rule, I never have to think about how my files are named because it is always the same. One could argue that I am just lazy and not very creative, but I rather save my creativity for things that require it more. Of course, any format works as long as you stick with it. For me, this is the simplest way to do it, but it requires a bit of getting used to. Still, I hope the principle is clear and you find a way to implement your version of it for your filing system.

3. Add a date for automatic chronological order

Whenever I open a file, my first step is to save it under a different name. This step is helpful because if, for example, I make a mistake, accidentally delete content irrevocably, or the programme crashes, I always have a previous version of my file. So the only change I make to the filename is to add a different date at the end. Doing this consistently will automatically sort all your files in chronological order, with the latest version always featuring at the bottom if you have your files sorted in alphabetical order. The way I add a date to my files is adapted from ISO 8601, an international standard for dates that is recognised worldwide.

After some time, this will probably result in 20 copies of the same file. However, if you could choose, would you rather have 20 copies on your computer which work or one that could be easily broken and destroys your hard work of the past three months? The 20 copies suddenly look very attractive. No?

To keep things ‘clean’, I always have an archive folder to store previous versions and only keep the latest version in the main folder (find out why ‘archive’ folders are so handy).

Bonus tip: Add your initials when working in a team

When collaborating in teams it can be helpful to indicate revision of files by including initials

Figure 4: When collaborating in teams it can be helpful to indicate revision of files by including initials

If you collaborate with others, you often have multiple versions of a document on the same day. A common practice I adopted from a dear colleague is using my initials to indicate revisions I made, i.e., adding a +dd at the end. You can stack those initials as many times as you want, and it will not interfere with the chronological order of files. Then, once a new day starts, you can begin from scratch.

Concluding remarks

In most cases, using such file naming conventions has many benefits. The only downside is to get used to it and to remind yourself to remain consistent. It can be challenging to resist the urge to deviate from it because sometimes it might seem more convenient. However, the convenience now can become a real pain later.

Together with the other workflow hacks I covered before, these productivity strategies carried me through all my projects so far without ever facing any issues. I also noticed that others quickly adapt to this file naming system because it is easily recognisable, which is a good indicator of its usefulness.

It is crucial that you do not simply copy what I have shown in this and other posts (of course, you are welcome to do so), but make it work for you. Give it a try, and you might never revert to your old way of thinking about your digital workspace. If you have some unique strategies to name your files let me know about it on Twitter. I am sure you have some neat tricks I can implement in my own workflow.

Until next time, remember to read, research, write and repeat!