Plurals in directory names

Please compose all posts in Emacs.

Moderators: phlip, Moderators General, Prelates

Directory names should be:

Plural.
16
84%
Singular.
3
16%
 
Total votes: 19

User avatar
azule
Saved
Posts: 2121
Joined: Mon Jul 26, 2010 9:45 pm UTC
Location: The land of the Golden Puppies and Rainbows

Plurals in directory names

Postby azule » Wed Nov 19, 2014 6:42 am UTC

What is preferred: plural or singular?

For example an article directory with all articles numbered. It would look like "/article/1/". It could be read as "article one". But since it obviously will contain many articles should the directory be plural? Then it would be read "articles one", which doesn't scan as well in English.

But directories by their nature hold multiple items. Is it redundant to note the plural nature?

Related edit: What about an abbreviation that is plural such as for "images", should it be "img" or "imgs"? (Both of which are plural but one has the explicit pluralizing "s".)

Directory, in this case, is a synonym for folder.
Last edited by azule on Wed Nov 19, 2014 9:23 am UTC, edited 1 time in total.
Image

If you read this sig, post about one arbitrary thing you did today.

I celebrate up to six arbitrary things before breakfast.
Time does drag on and on and contain spoilers. Be aware of memes.

Derek
Posts: 2106
Joined: Wed Aug 18, 2010 4:15 am UTC

Re: Plurals in directory names

Postby Derek » Wed Nov 19, 2014 7:54 am UTC

The directory should be plural, and your files shouldn't be named single numbers.

User avatar
eviloatmeal
Posts: 547
Joined: Thu Dec 11, 2008 9:39 am UTC
Location: Upside down in space!
Contact:

Re: Plurals in directory names

Postby eviloatmeal » Wed Nov 19, 2014 8:50 am UTC

If you're planning to put more than one thing in the directory, and the directory name describes the things, it'd better be plural.

/articles/
/pictures/
/games/
/backup/ (where you put one big monolithic backup)
/backups/ (where you would put a number of backups of different things)

Also, naming a folder "1" is a really effective way to set yourself up for several hours of head-scratching and haphazard searching in a month, when you forget what the heck "1" contains, and where all your important files are. If that's your naming scheme, then the plural thing hardly matters much, now does it? :lol:

Same with stuff like "/misc/". Once I name a directory "/misc/" or "/miscellaneous/" or similar, it immediately becomes a bottomless pit of bitrot, and anything you put in there is going to be lost forever. Although, it is fun to go digging through those, every once in a while. Just don't expect to ever find anything when you need it.
*** FREE SHIPPING ENABLED ***
Image
Riddles are abound tonightImage

User avatar
azule
Saved
Posts: 2121
Joined: Mon Jul 26, 2010 9:45 pm UTC
Location: The land of the Golden Puppies and Rainbows

Re: Plurals in directory names

Postby azule » Wed Nov 19, 2014 9:10 am UTC

I've added an abbreviated question to the first post. (img vs. imgs)

Derek wrote:The directory should be plural
Thanks. So far it's 3 to zero (if you voted) in favor of plural.

I know that xkcd does it as plural, such as "comics", but also when there's a subdirectory of that, it's not plural, such as "frequency". I know that's a title (the comic "Frequency") but what it has is multiple files. Now you can see why there's plenty of confusion on this.

Derek wrote:your files shouldn't be named single numbers.
That's not the topic at hand. But, are you saying that Randall is doing it wrong with his comic page numbering (see eviloatmeal's link)?

eviloatmeal wrote:/backup/ (where you put one big monolithic backup)
/backups/ (where you would put a number of backups of different things)
Doesn't something like this cause a lot of problems. If the nature of your directory changes because you add one more item, calling it backup would be bad now, right? I know there's the SEO issue of consistent directories, like "link rot" and all that. 301 redirects should probably be avoided, especially if you're relying on it to fix a naming issue.
Image

If you read this sig, post about one arbitrary thing you did today.

I celebrate up to six arbitrary things before breakfast.
Time does drag on and on and contain spoilers. Be aware of memes.

Ubik
Posts: 1016
Joined: Thu Oct 18, 2007 3:43 pm UTC

Re: Plurals in directory names

Postby Ubik » Wed Nov 19, 2014 9:25 am UTC

Maybe there's a miscommunication here? You seem to be talking about the path part in web URLs, but mentioning directories and folders might have given the impression you're talking about organising file systems (like user's home directory or similar).

User avatar
eviloatmeal
Posts: 547
Joined: Thu Dec 11, 2008 9:39 am UTC
Location: Upside down in space!
Contact:

Re: Plurals in directory names

Postby eviloatmeal » Wed Nov 19, 2014 9:30 am UTC

azule wrote:If the nature of your directory changes because you add one more item, calling it backup would be bad now, right?

No, I don't mean to say that you should change your directory name based on the number of items, I mean that if what goes inside is a set of items, such as, for example, various backups of various different things, then the directory name should be plural. But if the stuff inside is more like a unit, such as, for instance, a daily backup of your entire <whatever>, then the directory name would be singular.

Backups was just the first thing that came to mind as an example of something that could be either.

Another example of that might be: "/websites/" if you work on a lot of different websites for different clients, and "/website/" for a directory that contains various files relating to your personal website, but just that one website.

You wouldn't ever change the name to or from plural, it's just an example highlighting the difference between plural and singular.

@Ubik - Is there a considerable difference? In both cases it's a question of organisation and usability, no? A filesystem is a filesystem, no?
*** FREE SHIPPING ENABLED ***
Image
Riddles are abound tonightImage

User avatar
azule
Saved
Posts: 2121
Joined: Mon Jul 26, 2010 9:45 pm UTC
Location: The land of the Golden Puppies and Rainbows

Re: Plurals in directory names

Postby azule » Wed Nov 19, 2014 9:39 am UTC

I see what you're saying, eviloatmeal, that what directory you're creating should probably be considered to have a certain purpose therefore helping you to figure out what to call it. Your example of "/website/" for a personal website, it's pushing me to agreeing with pluralizing everything (hah) because what if I then have two personal websites (two incompatible subjects)?

Ubik wrote:You seem to be talking about the path part in web URLs, but mentioning directories and folders might have given the impression you're talking about organising file systems.
All of the above. Are they that different? I have my web structure mirrored on my computer and therefore I operate with the understanding that anything I create might end up being a webpage online, so I don't want to have to rename anything for it to work online. It seems that the rules should apply everywhere.

I snuck in an additional question. It's the img(s) question. See my previous two posts. lol.
Image

If you read this sig, post about one arbitrary thing you did today.

I celebrate up to six arbitrary things before breakfast.
Time does drag on and on and contain spoilers. Be aware of memes.

User avatar
Thesh
Made to Fuck Dinosaurs
Posts: 5309
Joined: Tue Jan 12, 2010 1:55 am UTC
Location: Colorado

Re: Plurals in directory names

Postby Thesh » Wed Nov 19, 2014 9:51 am UTC

azule wrote:IAll of the above. Are they that different? I have my web structure mirrored on my computer and therefore I operate with the understanding that anything I create might end up being a webpage online, so I don't want to have to rename anything for it to work online. It seems that the rules should apply everywhere.


Friendly URLs like /article/1 might not map to a directory called articles, but instead be the logical equivalent of /article.php?id=1, in other words you are displaying the article with ID 1. What makes sense depends on what it is logically representing.
Honesty replaced by greed, they gave us the reason to fight and bleed
They try to torch our faith and hope, spit at our presence and detest our goals

User avatar
eviloatmeal
Posts: 547
Joined: Thu Dec 11, 2008 9:39 am UTC
Location: Upside down in space!
Contact:

Re: Plurals in directory names

Postby eviloatmeal » Wed Nov 19, 2014 9:56 am UTC

If you start off with one, and later acquire a second personal website, then I would consider reorganising into "/website_a/" and "/website_b/", or "/websites/a", "/websites/b". Is moving / renaming directories really such a bad thing that you shouldn't ever do it? You have to do it sometimes. Organising everything as generic subdirectories is going to get just as cluttered as not organising, after a while. I would hate to have "/pictures/funny/captioned/animals/cats/kittens/<breed>/" just in case I ever accrue more than 3-4 captioned cat pictures and need more granularity than "/pictures/funny/captioned/".

As for "img" versus "imgs", again, I think if you're dropping the strict semantics, then it really doesn't matter. I'd prefer "img", myself, out of those, because it's a little more typical of an image folder, whereas "imgs" might be where you're storing your International Mammalian Genome Society files... or something.
*** FREE SHIPPING ENABLED ***
Image
Riddles are abound tonightImage

Derek
Posts: 2106
Joined: Wed Aug 18, 2010 4:15 am UTC

Re: Plurals in directory names

Postby Derek » Wed Nov 19, 2014 11:36 am UTC

azule wrote:That's not the topic at hand. But, are you saying that Randall is doing it wrong with his comic page numbering (see eviloatmeal's link)?

No, but I would hope that his files on disk aren't named the same as his URLs.

User avatar
eviloatmeal
Posts: 547
Joined: Thu Dec 11, 2008 9:39 am UTC
Location: Upside down in space!
Contact:

Re: Plurals in directory names

Postby eviloatmeal » Wed Nov 19, 2014 11:53 am UTC

What's wrong with his URLs?

The number ones are just for browsing convenience (and turned out to be a popular way to reference them (although I have yet to see any success referring to an XKCD purely by its number outside of echochamber or a conversation about XKCD), such as in the XKCDSW thread), I don't think they have much relevance to how things are stored.
*** FREE SHIPPING ENABLED ***
Image
Riddles are abound tonightImage

User avatar
Copper Bezel
Posts: 2406
Joined: Wed Oct 12, 2011 6:35 am UTC
Location: Web exclusive!

Re: Plurals in directory names

Postby Copper Bezel » Wed Nov 19, 2014 1:30 pm UTC

I don't see a path as an ordinary English statement separated by meaningless slashes. The slash has a semantic meaning, too, and the folder is a named object that transparently describes the thing or things it contains. Within images, ponies; within ponies, muffin.jpg. images/ponies/muffin.jpg. And yeah, a singular folder name usually means "files associated with this single thing." articles/article_1/article_1.html.
So much depends upon a red wheel barrow (>= XXII) but it is not going to be installed.

she / her / her

Ubik
Posts: 1016
Joined: Thu Oct 18, 2007 3:43 pm UTC

Re: Plurals in directory names

Postby Ubik » Wed Nov 19, 2014 6:25 pm UTC

I do consider URL paths and filesystem paths to be different. There's definitely a large overlap, but I think the two main differences are the way the two are browsed, and that one is primarily something very public and another mostly private.

The usage difference is mostly between a very generalized file system browser and very specialized web sites. Browsers themselves are general-purpose, but pretty much every website exposes their content through a custom interface. While file browsing is more and more content-centered with image thumbnails and text document previews, the file names keep on being very important (instead of, say, titles lifted from the documents), whereas on the web the sites don't tend show the URLs of links but a more or less custom text.

The public-private part mostly boils down to URLs that should stay the same and the more local and private filesystems where reorganizations (without equivalents of 301 redirects) are more common and acceptable - at least when talking about personal file organization. The stability or URLs also is a thing that in my opinion makes it more acceptable to use numeric ids.


Anyway, I don't actually have a strong opinion on the plural issue, but looking at my home directory, I see plurals there, but also nouns like "wine" for Wine software or "programming" under "documents". A comparison that came to my mind was plural vs. singular in database table names, but that isn't the same thing, as directories or URL paths are not a "type" in the sense a table is.

I guess plural is okay.

User avatar
azule
Saved
Posts: 2121
Joined: Mon Jul 26, 2010 9:45 pm UTC
Location: The land of the Golden Puppies and Rainbows

Re: Plurals in directory names

Postby azule » Thu Nov 20, 2014 7:04 am UTC

It's now 6 to 1 in favor of plural. I want to hear from this "singular" person. I need your opinion, too, [person]!

Thesh wrote:Friendly URLs like /article/1 might not map to a directory called articles <snip/>
Sure. I know. Different topic, right? hah. (I wrote "/article/1/" with the trailing slash, because this was a directory with an invisible "index.html" or whatever. Just an example, one that was similar to xkcd.)

eviloatmeal wrote:I would hate to have "/pictures/funny/captioned/animals/cats/kittens/<breed>/"
Ja. Reorganizing locally might be a bit different than online, true. Thinking ahead about the structure for an online directory is probably more important than offline. But even online that kind of granularity is probably not preferred. *shrug*

eviloatmeal wrote:I'd prefer "img", myself, out of those, because it's a little more typical of an image folder
Thanks. I'm not sure I agree with it's typicalness. I've seen "imgs" lots of places, from xkcd's sub domain to sub folders on wordpress. I'd take this one similar to the argument with math over maths (where the question is should the s exist on a shortened plural word).

eviloatmeal wrote:What's wrong with his URLs?

The number ones are just for browsing convenience, I don't think they have much relevance to how things are stored.
Aimed at Derek too: How does he connect that image url to the indexed url? It's probably in a database. He can probably look it up with either number or image url or description. If he were me, he'd probably have them symlinked with both number and comic title (because, those have changed more than once (so, they're volatile)).

Copper Bezel wrote:Within images, ponies; within ponies, muffin.jpg. images/ponies/muffin.jpg. And yeah, a singular folder name usually means "files associated with this single thing." articles/article_1/article_1.html.
Thanks for the reply. I was thinking, and this is sorta aimed at others too, that they're all basically plural, just that some are collective nouns (essentially plurals), hence the ones that are titles.

I think, if directories were rooms, places where things were stored, we'd probably go look in the "article" room, not the "articles" room. But, I don't have one of those rooms, so I wouldn't know if they're called that.

Copper Bezel wrote:The slash has a semantic meaning, too, and the folder is a named object that transparently describes the thing or things it contains.
I didn't totally get this. So, are we sort of comparing this to programming languages? I had a similar question with that. Javascript being my language, I've continued to wonder if my array names should be plural or singular, because when I use them (such as in a loop) they'll be listed such as "item[1]" where item is the full collection and [1] is the single item I'm accessing. Same thing here, that I want to read it in English. }_{
Image

If you read this sig, post about one arbitrary thing you did today.

I celebrate up to six arbitrary things before breakfast.
Time does drag on and on and contain spoilers. Be aware of memes.

elasto
Posts: 3059
Joined: Mon May 10, 2010 1:53 am UTC

Re: Plurals in directory names

Postby elasto » Sat Dec 13, 2014 3:32 am UTC

azule wrote:So, are we sort of comparing this to programming languages? I had a similar question with that. Javascript being my language, I've continued to wonder if my array names should be plural or singular, because when I use them (such as in a loop) they'll be listed such as "item[1]" where item is the full collection and [1] is the single item I'm accessing. Same thing here, that I want to read it in English. }_{

Arrays should definitely be pluralized. You don't only reference individual elements of an array; Sometimes you pass around and perform functions on the whole array.

Having a variable called 'item' acted upon which actually isn't a single item is misleading.

It would also preclude using a variable called 'item' when looping through each element of the 'item' array which would otherwise be very natural.


Return to “Religious Wars”

Who is online

Users browsing this forum: No registered users and 6 guests