Speaker
Trey Hunner
Material
Note
- PEP 8
- Read it every 6 month
- It's not your project style guide
- It's just a start point
- Naming things
- Don't be afraid of using long variable names
- Use tuple unpacking in for loop
- Optimize for accuracy instead of short variable names
- Instead of commenting operation, consider using descriptive variables.
- Programming idioms
- duplicated code around other code → context manager →
contextlib
- list from list → list comprehension
- Operator Overloading, Abstract Base Classes
- Functions with shared data → class
- Readability checklist
- Can I modify line breaks to improve clarity?
- Can I create a variable name for unnamed code?
- Can I add a comment to improve clarity?
- Can I turn a comment into a better variable name?
- Can I use a more specific programming construct?
- Have I stated detailed preferences in a style guide?
Share on:
Twitter
❄ Facebook
❄ Email