Code Style

Code that lives beyond its initial development will be read many times more than written as the project is maintained and new features are added. Establishing and following a standard style in your projects will increase readability, make maintenance easier, and can reduce onboarding time for new developers.

While code style can be personal, languages usually have at least a few dominant coding styles which are familiar to most programmers in that language. When programming in Python, the most commonly followed style is some variation of PEP 8. In Python, you might also consider adopting type hinting for large projects. Documentation embedded in the code through documentation strings or comments is a crucial aspect of code style you should also establish for your projects.

Automatic formatting tools can enforce a particular coding style and are often configurable for each project.

Example of a coding style guides: