Which naming convention should be used? Add or Create?
Answered
Holland Lop posted this in #help-forum
Holland LopOP
I am creating an async function which the purpose is to add new customer to the database. Are there any naming convention that is commonly used? I'm contemplating between using CreateCustomer or AddCustomer.
I will also have another function to create new order. should i standardize the naming, like if i use AddCustomer, should the order one be AddOrder, or should I use CreateOrder, as it sounds more natural?
I will also have another function to create new order. should i standardize the naming, like if i use AddCustomer, should the order one be AddOrder, or should I use CreateOrder, as it sounds more natural?
Answered by Masai Lion
Up to ya I usually use something like createUser, createProduct, newUser, etc. both of your naming conventions are forward enough so if someone else reads them it should be obvious what the intend is.
2 Replies
Masai Lion
Up to ya I usually use something like createUser, createProduct, newUser, etc. both of your naming conventions are forward enough so if someone else reads them it should be obvious what the intend is.
Answer
Holland LopOP
thanks. i thought that there is a naming convention for something like this, this question also applies for getCustomers and fetchCustomers.