Logan Bailey

Adventures In Web Development

Blog, About, GitHub, and LinkedIn

The pluralization of a directory's name depends on the relationship between the name and the contents of the directory. A directory’s name should be plural when it describes the type of files the directory contains. In programming, a good example of this is a Controllers directory in an MVC architecture. The Controllers directory only contains controller files and therefore is plural. In real life, you might have a directory called pictures that contains image files. Directory names should be singular when the name describes how the files are grouped beyond their type. In programming, an example of this would be a Post directory that could contain files relating to fetching posts from the database and performing actions on them. Since the name of the directory describes how the files are grouped together, the directory name is singular. In real life, you might have a directory that contains pictures from your kid's birthday party called Jacobs Birthday.

A parent directory's plurality has no effect on the plurality of its children's names. Your directory, Jacobs Birthday, could logically be found in pictures/Jacobs Birthday or it could just as logically contain a pictures directory, Jacobs Birthday/pictures/. When the directory name describes the file types it contains, then it should be plural.

Posted In:
Programming