Created
January 30, 2020 06:04
-
-
Save dtoma/f1f0a9d436cf1a589d54fbd7dee80e72 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Code quality | |
## Level 0 | |
Typically a script that is ran once or occasionally. Defining characteristics include: | |
- No functions, code is copy-pasted rather than factored out | |
- No logging | |
- Values are hardcoded, eg. write `3.14` all over the place instead of using `PI = 3.14` | |
- `assert` isn't used anywhere | |
- No typing (or stringly-typed) | |
- State is everywhere | |
- Nested control flow | |
```python | |
for value in container: | |
if value in ['some', 'hardcoded', 'values']: | |
for suffix in suffixes: | |
print(value + suffix) | |
``` | |
## Level 1 | |
- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment