Master the art of crafting clear and concise code by eliminating redundant context in variable names. Elevate code readability and maintainability effortlessly.
If the context is already conveyed by the class or object name, there’s no necessity to duplicate it in the variable name.
Example
public interface IItemRepository
{
Item GetItemByID(int id);
List<Item> GetItems();
List<Item> GetItemByCategoryID(int iCategoryID);
List<Item> GetItemBySupplier(int iSupplierID);
List<Item> GetItemByCustomer(int iCustomerID);
void UpdateItem();
void DeleteItem();
}
C#public interface IItemRepository
{
Item GetByID(int id);
List<Item> List();
List<Item> ListByCategoryID(int iCategoryID);
List<Item> ListBySupplier(int iSupplierID);
List<Item> ListByCustomer(int iCustomerID);
void Update();
void Delete();
}
C#