- Case: PascalCase
- Keep it short and descriptive. Preferably a noun e.g. Car, Bird, MountainBike. Avoid acronyms and abbreviations.
- Eg: OrderNumberGenerator() or Order()
- Case: snake_case/lower_with_under
- eg: self.items_list = []
- Case: snake_case/lower_with_under with initial underscore
- eg: _failure_count = 0
- Case: CAPS_WITH_UNDER aka SCREAMING_SNAKE_CASE
- Should be all uppercase letters and if the name contains multiple words, it should be separated by underscores (_)
- eg: Global: ACTIONS_COLLECTION, Class Constant: RANDOM_SEED = 42
- Case: snake_case
- keep it descriptive -- may be long. Don't use camelCase or PascalCase.
- eg: order_id = 1
- Case: snake_case
- Use names that ask questions (Yes or No)
- eg: is_valid = False
- Case: snake_case
- Use names that are plural to signify a collection of items or append "_list"
- eg: names = [] or items_list = []
-
Case: snake_case
-
Use "natural naming" for dictionaries that don't fit the subtypes i.e. name it based on the values in the dict. or append "_dict"
-
eg: profile_details = {"first": "Albert", "last": "Einstein"} or users_dict = {"user1": {"name": "user1", "email": "[email protected]"}}
Subtypes:
Maps: - These are mappings of a set of objects from key to value. - Use "key_to_value" or "value_key_map" - eg: "key_to_value": oranges_to_apples = {"orange1": "apple1", "orange2": "apple2"} - eg: "value_key_map": days_api_hits_map = {"0": 100, "1": 200, "3": 90} - Tips: Use whichever suits the data. days_to_api_hits might be understood as an integer countdown to a certain api_hits value.
- Case: snake_case/lower_with_under
- Preferably a verb e.g. get_car(), purchase(), book()
- eg: create_random_number()
- Use the naming conventions of the programming language used.
- Case: snake_case
- Keep it short and descriptive. If your collection holds user details, name it "users" or "users_collection".
- eg: "products", "actions_collection", "addresses", "configurations".
- Case: snake_case
- Keep it descriptive.
- eg: In users collection, each document might have: {"email": "", "password": "", "last_login": "", "name": ""}
- Use the naming conventions of the programming language used. Preferably use Python Naming Conventions as it makes writing CRUD scripts easier (you can access the table columns directly without needing to put column names in quotes).
- Case: snake_case
- Short, decriptive and plural.
- eg: "orders" for orders table, "products" for products, "users" for user details etc.
- Case: snake_case
- Short, decriptive and singular.
- eg: "order_id" for order id number, "first_name", "last_name" of user etc.