***code is read much more often than it is written***
Each programing language has it's own guidlines:
* [PEP8 for Python](https://peps.python.org/pep-0008/)
* C++ does not have an official guidline, but [Stroustrup and Sutter](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md) is a good starting point
## Clean Code
* delete unused code blocks and only keep as few code as necessary
* fewer lines of code -> fewer bugs (add source to this statement)
* BUT: optimization should be in balance with code readability. Convoluted statements are ok if they improve the code efficiency, but might need to be accompanied by some sort of documentation.
## Efficient Code
::: {.smaller}
A collection and repetition of statements from previous lectures
:::
* use math if you can, else, keep the order of complexity of your code in mind and check whether it behaves as you'd expect (complexity lecture)
* reduce loops by vectorizing operations, e.g. in Python by using list comprehensions(?)
* efficient memory usage (memory?)
* use parallel processing if you can pinpoint the performance bottleneck to a task that can be split between multiple processors. (parallel programing?)
* ...
## Understandable Code / Documentation
code should be clear in itself, but also accompanied by a statement of its purpose and proper usage. Additional information could include input/output, author, or date information.
* in-line documentation: docstrings are string literals written into your code (add example?)
* comments
* separate documentation: common format is a text file, e.g. README.txt, or a chapter in a linked documentation file or handbook
## Version control for code changes
A version control software ensures a tracable record of code changes, it serves as a backup and is indispensible in any collaborative code development.
## Testing and Code Review
## Staying up to date
* stay up to date with coding trends and libraries
* be open and continue learning: new technologies typically improve your productivity