Skip to content

Instantly share code, notes, and snippets.

@slavagoreev
Created April 21, 2019 20:29
Show Gist options
  • Save slavagoreev/c0b01c2feba3b44e3895ab8f314bf202 to your computer and use it in GitHub Desktop.
Save slavagoreev/c0b01c2feba3b44e3895ab8f314bf202 to your computer and use it in GitHub Desktop.

Bad

  • Hardcoded templates
  • Violating 120 symbols per string
  • No DRY ever

Not so good

.gitignore

__pycache__
Parsers/__pycache__
backend/__pycache__
CATt/__pycache__
schedule/__pycache__
u_csv/__pycache__

May be transformed to: **/__pycache__

  • Do not fully copy code from open source without any change
  • Do not use SQLite
  • Dockerize
  • Deploy
  • Store globals in .env file
  • Bad code style
                {% for x in schedule %}
                  <tr>
  <th scope="row">{{ forloop.counter0 }}</th>
      {%  for l,k in x.items %}
            <td>{{ k }}</td>
          {% endfor %}
                  </tr>
  {% endfor %}

Could be transformed to:

{% for x in schedule %}
  <tr>
    <th scope="row">{{ forloop.counter0 }}</th>
    {% for l,k in x.items %}
      <td>{{ k }}</td>
    {% endfor %}
  </tr>
{% endfor %}

Good

  • git-flow policy
  • Usage of modernizer
  • Inheritance via prototypes (if you wrote it by yourself)
  • Python code looks gick-ish but it is hard to understand
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment