Get startedGet started for free

Human readable filenames

1. Human Readable Filenames

In this video, we'll think about file naming. This is probably something you've done hundreds if not thousands of times. So this should be easy? Right?

2. The humble slug

URLs slugs are the end part of a web address. Clearly, we want them to convey useful information. For example, which URL slug do you think is better: course1963 or efficient-r-programming

3. We can learn from slugs

We can learn from the humble slug. Compare ac.R to analysis clustering.R or 1.R to loading.R Where possible, provide information. In the same vein as chapter 3 and object formatting, consistency is key. I always use a capital R for my file extensions. All filenames a lower case.

4. Dates - what do we want?

Sometimes it's useful to have dates in file names. What we want is something that is unambiguous, so not certainly not 01/02/03 We also want the name to have nice sorting properties. Does this mythical date format exist?

5. Dates - ISO8601

Indeed, let me introduce you to the excitingly name ISO8601 standard. This standard specifies the simple format of year-month-day All dates are now obvious and sorting just works!

6. Numbers are good

Numbers are also handy. For this course, I have directories called chapter 1 and chapter 2. Note the use of 01. I now do this automatically in case I have over 9 directories or files. Simple, yet very effective.

7. Let's practice!

Let's put this new found knowledge to practice.

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.