Favor simple, readable implementations over complex or overly abstracted solutions. This includes eliminating code duplication through better function design, simplifying complex expressions, and using standard library functions instead of custom helpers.
Key practices:
paths.basename
or AsciiStrToUpper
) over custom helper functionsExample of simplification:
# Instead of duplicating calls:
if generate_no_pic_action:
_create_helper(..., use_pic=False)
if generate_pic_action:
_create_helper(..., use_pic=True)
# Use a loop:
use_pic_values = []
if generate_no_pic_action:
use_pic_values.append(False)
if generate_pic_action:
use_pic_values.append(True)
for use_pic in use_pic_values:
_create_helper(..., use_pic=use_pic)
This approach reduces maintenance burden, improves readability, and makes code easier to understand for future developers.
Enter the URL of a public GitHub repository