plone.restapi icon indicating copy to clipboard operation
plone.restapi copied to clipboard

Reason for Singular versus Plural seems wrong

Open aaiezza opened this issue 3 years ago • 2 comments

Great guidelines for REST here. I had one critique for those interested.

The reason given for the "Singular versus Plural" resource naming case doesn't feel like it justifies doing one over the other. https://github.com/plone/plone.restapi/blob/b51b2e97235b1a03a3bc21a93fc62d0ae638b4a2/docs/source/conventions.md?plain=1#L71-L73

Rather, it sounds like a great reason to favor consistency.

That aside, I do think it is unreasonable to impose an opinion on this matter. Many people prefer the plural for describing a collection of things. However, modern OO class naming convention would very much encourage you to use the singular form, though many instances of a class can exist. A similar conversation can be had over database table names in a relational database.

I don't think there is an answer, I think consistency is key. Therefore, I think the rule here should not be "Singular versus Plural", but rather to be one or the other wholeheartedly. And I do believe that consistency should bleed into the codebase naming conventions as well.

Just food for thought.

aaiezza avatar Apr 27 '22 17:04 aaiezza

@aaiezza not sure I fully understand what you suggest here. I agree, there is no right or wrong on this topic. We made a decision for plural for consistency reasons. Are you suggesting that we change the headline to "Use Plural for resource naming" to make this decision more obvious?

tisto avatar May 04 '22 09:05 tisto

@tisto that might be helpful for the sake of driving home the consistency idea in this document.

However, I could see a note being present with this list of conventions reminding viewers that these are Plone's decisions, not necessarily something that would work everywhere or should be adopted as-is by everyone. I see people referencing this doc https://6.docs.plone.org/plone.restapi/docs/source/conventions.html as the end-all, be-all of REST conventions that everyone should do.

aaiezza avatar Jun 20 '22 15:06 aaiezza