DEV Community

[Comment from a deleted post]
Collapse
 
orkon profile image
Alex Rudenko

You can try to use singular form only for consistency and if you have a collection of objects use a prefix or suffix indicating that this is a collection: e.g. productList, productArray, l_product, a_product. I don't like this that much but also I would try to avoid bad English. Perhaps what can also help is to use only words which have simple s ending in the plural form, for example, instead of inventory use inventoryItem which becomes inventoryItems

Collapse
 
hdv profile image
Hussein Duvigneau • Edited

It's funny I've done this many times for projects in the past, as a habit I picked up from Backbone.js where their convention is to append model names with "_collection" (so "product" becomes "product_collection"), yet it didn't occur to me this time around. It's horrifying how taking over legacy projects can screw with ones mind...