Refactoring (notes)

last update: 2021-08-14

Make it work, make it right, make it fast
Kent Beck (attributed)

Test, Change, Test again

The Zen of Python, by Tim Peters:

import this

Write code that's

Think of every line of code as a message for someone in the future.
Linda Rising

When you look at source code, the meaning of the program should be apparent. [...] If your code needs comments, consider refactoring it so it doesn’t.
Peter Sommerlad

Style

Coding Standard

Examples for real-world coding standards:

Use tools to facilitate processes, but don't let the tools become ends in themselves.

Tools

pep8
A tool to check your Python code against some of the style conventions in PEP 8.
pyflakes
simple Python source checker
pylint
python code static checker
...
cppcheck
Tool for static C/C++ code analysis (in repositories)
cpplint.py
Lint for Google's C++ coding style
...

Examples