3 ms·
"Rule #1: DO use plural nouns for collections" I disagree, as you then have to deal with English pluralization rules to match single objects and collections.
by jacknews 3y ago
"Rule #1: DO use plural nouns for collections"
I disagree, as you then have to deal with English pluralization rules to match single objects and collections.
Also database tables should just be singular, things like 'country.id' makes more sense than 'countries.id'.
Also no discussion of versioning?
- _lvbh 3y agoIt would be countries[i].id (or country.id in a forEach)
- LAC-Tech 3y agoEnglish pluralisation rules are a non issue. 1.5 billion people world wide speak English, and I'll forgive some of them if they accidentally make a gooses URL instead of a geese one.
- jacknews 3y agoWhy have plural at all. All rest urls except index, which is easily discernible because it has no id, make more sense in the singular: get /ticket/12 patch /ticket/12 put /ticket The problem is not humans getting confused by 'gooses', but that sometimes your code has to do the mapping, and there are plenty of edge-cases. Just avoid the issue entirely by sticking with singular throughout.