Skip to content

Instantly share code, notes, and snippets.

@dtoma
Created January 30, 2020 06:04
Show Gist options
  • Save dtoma/f1f0a9d436cf1a589d54fbd7dee80e72 to your computer and use it in GitHub Desktop.
Save dtoma/f1f0a9d436cf1a589d54fbd7dee80e72 to your computer and use it in GitHub Desktop.
# 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