Clean Code Nugget 2: Functions
Published in
1 min readMay 7, 2019
As part of our code quality initiative (to help people across RES to write better code and produce better software), we recently held our second Clean Code Nugget meeting to discuss how to write better functions.
- A brief recap of what Clean Code is.
- A couple of concepts related to functions
- Guidelines to writing good functions.
Here are a couple of links that we referred to in our discussions:
- Function lengths: https://www.martinfowler.com/bliki/FunctionLength.html
- Python data classes: https://docs.python.org/3/library/dataclasses.html
- Python named tuples: https://docs.python.org/3/library/collections.html#collections.namedtuple
- On constructor over injection: https://blog.ploeh.dk/2018/08/27/on-constructor-over-injection/
- Python type hints: https://www.python.org/dev/peps/pep-0484/
- Logging: https://martinfowler.com/articles/domain-oriented-observability.html
Stay tuned for further videos, and happy coding!