Code Style

Code that lives beyond its initial development will be read many times as part of routine  maintenance and as new features are added. For this reason, it is essential to comment your code thoroughly: it will reduce the time and effort to understand your code when you come back to it some months or years later. Establishing and following a standard style in your projects will also 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 that 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.

MolSSI recommends using automatic formatting tools that can enforce a particular coding style. These are often configurable for each project.

Example of a coding style guides: 

Code Style Tutorials: