Choose clear, descriptive names for variables, functions, and classes that accurately convey their purpose and follow framework conventions. Avoid abbreviations, single-letter names, or generic placeholders that might confuse readers.
Choose clear, descriptive names for variables, functions, and classes that accurately convey their purpose and follow framework conventions. Avoid abbreviations, single-letter names, or generic placeholders that might confuse readers.
Key guidelines:
Example:
# Poor naming
def get_pagination(self, request, **kwargs):
p = self.pagination_cls()
return p
# Better naming
def get_pagination_class(self, request, **kwargs):
pagination_instance = self.pagination_class()
return pagination_instance
This approach improves code readability, maintains consistency with framework patterns, and makes the codebase more maintainable.
Enter the URL of a public GitHub repository