8

I work on a web site where we are having a major re architecture. There is a point which may be a little persnickety but I can't see a standard one way or another.

When you are using real words in a URL with a / as a separator should you use a singular or a plural of the type. So

/user/fred

vs

/users/fred

SO seems to use "questions", "users", etc. but I was wondering if there is any authoritative advice either way.

PS. I couldn't work out if this belonged on SO SU or SF. Please feel free to move if you can work out which bucket it should go in.

6 Answers 6

14

I've always heard that it doesn't matter as long as you're internally consistent.

That being said, in *nix system architecture it's always singular. (e.g "user", "home", "mnt", etc (or should that be "etc"?)), so that might be a better default since it's already common?

2
  • That explains why I think that singular makes more sense. Oct 12, 2009 at 15:20
  • I think of the *nix folder names as abbreviations of the plural form: usr:users, lib:libraries, and so on. Many full length directory names are actually plural: /usr/share/xsessions, /usr/share/applications, /sys/devices. Yet, some are singular, like /home, so there does not seem to be a strictly followed convention. I tend to use the full name in plural and the abbreviation without a trailing "s". I think of most abbreviations as plural as a type. Mar 15, 2016 at 14:22
5

I personally prefer the plural, it indicates that there is a collection of Users, in which you are looking for fred.

1
  • Well, the sheer fact that the word User is a path part (i.e. a parent node in a namespace tree), pretty much implies that there are several children underneath. At least that's the overwhelmingly common -- and also natural -- case (with hierarchies in general), as opposed to the exceptions, where there's only one single item to be expected below a parent node.
    – Sz.
    Apr 12, 2023 at 15:31
3

To make @Satanicpuppy answer more precise, it's not always true that in *nix system architecture it's always singular. I think in *nix systems, since system admins are mostly accessing it using terminal, the priority is to type less, and that's why we

    have proc and not process,
    have mnt and not mount,
    have var and not variable,
    have usr and not user,
    ...

and the list goes on, another reason they used abbreviation(discussion here is not about singular or plural form, it's about why it's abbreviated). Regardless of OS it there were limitations on file system in old days. Limitations were on both Maximum Pathname Length and Maximum Filename Length . Maybe you can remember( if you are old enough;) ) a verylongnames.txt file turned into verylo~1.txt on windows, and if not here is the explenation).

But in recent years everything has changed: limitations has gone, nowadays UX and readability is an important issue, and most users use GUI to interact with computers. And that's a good reason that on all major operating systems(Linux, OS X and Windows) the users directory naming convention is the same:

    Users 
       '-Documents
       '-Downloads
       '-Movies/Videos
       '-Pictures

the only exception is that Users directory on linux is called home.


Other than the above reasons it is more common to use plural forms on the web:

In Django it's common to use plural form: like the polls app tutorial on the django documentation:

    # To get a list of polls
    /polls/ 

    # To get an individual poll item
    /polls/5/

Another good example is google, which uses:

    google.com/analytics
    google.com/analytics/settings
    google.com/analytics/feeds
    google.com/books
    google.com/catalogs
    google.com/maps
    google.com/places
    google.com/trends

also Bing uses plural form:

    bing.com/images
    bing.com/maps
    bing.com/results
    bing.com/videos

And of course stackoverflow:

   stackoverflow.com/users/
   stackoverflow.com/feeds/
   stackoverflow.com/questions/
   stackoverflow.com/tags/
   stackoverflow.com/help/badges
2

I prefer the singular /user/fred because it's more grammatically correct to the layman: you're looking at a user profile, for the user fred. However if /users/ shows all users, then /users/fred makes more sense.

Ultimately @Satanicpuppy is correct, what matters is that you're consistent.

1
  • 1
    URLs emerged from classical file paths. A file system knows files and directories (aka folders in modern OSes) that group files or directories together. /users is the directory that would group all users together. As there can be any number of users and usually there's more than one, plural makes sense. /users/fred is picking the one user named fred out of the group of all users. That seems totally meaningful to me. When you use /user/fred instead, you use /user just as a "tag" to tag that "fred" is a user name, but here you are abusing paths syntax to compensate missing namespacing.
    – Mecki
    Jun 22, 2018 at 9:44
2

Either way, it's probably a good idea to set up a 301 redirect from the wrong one to the canonical version. That way, when someone types a link instead of copy-pasting it, they get a 301 instead of a 404.

Personally, I'd have /users/ as the page with a list of users on (if there is one) and /user/fred/ as fred's home page. But that's messy to make work, especially if you want to use 301 redirects, so on a real system, I'd pick one and stick to it.

1
  • 1
    +1 for 301 redirects, good idea!
    – Josh
    Oct 12, 2009 at 18:02
1

I prefer plural. If you imagine your site not being dynamic, and you had to create the site just using folders and files that was served by apache. Then the folder would be plural. For example documents rather than document.

Not the answer you're looking for? Browse other questions tagged .