Staying sane: Rules on consistent file naming practices
One important component of maintaining order and sanity with your files if you do any significant amount of computer work (or even if you don’t) is making sure you have established rules for naming files and folders. You can develop your own or you can use rules developed by others. I’ve taken a bit from all over the place (including from the University of Edinburgh website), incorporated some of my own thoughts on filenaming, and decided to put it up on my blog so others may have a starting point to developing their own. Below I have detailed my filenaming rules that I try to be strict about.
A brief note: Some programs have different rules, so of course use the rules dictated by whatever program you are using. Two examples: 1) In SAS, hyphens in file names are not allowed; 2) Jekyll (used by Github Pages that generated this blog) uses slightly different filenaming rules than my own personal rules, so I use which rules are appropriate for the program/situation.
File (and Folder) Naming Rules:
Keep the names short, but meaningful. Remove unnecessary words such as “the”, “and”, “a” etc.
Don’t include spaces and avoid underscores (debatable and/or situational). For a string of words, capitalize the first letter of each word, except for the first word (e.g.
Use hyphens to separate important parts of the name or when there is an abbreviation followed by another word. For example,
diabetesRisk-AnalysisOutputwhich separates the two concepts, the project descriptor
diabetesRiskand the contents of the file
AnalysisOutput. Another example:
Avoid redundancy in file names and file paths (folder names). For example, don’t use
folderName/fileName-folderName.txtand instead use
folderName/fileName.txt. Another example: don’t use
diabetesSatFats/analysis-DiabetesSatFats.sasand instead use
If a number is included in the filename, such as for the version number, use two digits not one (e.g.
When including a date, include it at the very end of the filename and in the international standard format
I hope these rules help you start with developing your own set of rules!