4
Zen of LBRY Development
Lex Berezhny edited this page 2018-07-31 12:34:12 -04:00
- Write less code that does more in a clear way.
- Write a manageable amount of thoughtful unit tests to aid in future refactoring but prefer integration tests to prove your code actually works.
- Craft intuitive and composable APIs.
- Don't create a class when there is no state to manage.
- Avoid loops in unit tests.
- Learn and use many of the
unittest
assert methods. - Use function name to document what the function does.
- Split large functions into smaller ones and see previous rule.
- Don't write redundant comments or doc strings.
- Do write comments or doc strings to include references to specifications or other resources.
- Prefer writing clear code instead of clear comments to explain unclear code, clearly.
- Too many unit tests makes refactoring cumbersome.
- Not enough unit tests makes refactoring uneasy.
- KISS
- The Zen of Python