by snarfy · 5y ago · 0 comments
cat -> cats,
dog -> dogs,
child -> children,
person -> people,
etc.
It makes my code feel inconsistent too. Sometimes I use more specific typing to resolve this, e.g. PersonList , but I'm not sure that's any better.
In this scenario, consistency is more useful than grammatical correctness [1]. And the simpler pluralization logic makes it easier for non-English speakers to work with the codebase.
[1] Related example: https://en.wikipedia.org/wiki/HTTP_referer#Etymology
Things are object_detail (singular) and object_list (plural).
It just assumes 'append s' for plural displays, unless you override. I like the _list suffix instead of trying to pluralize