This course has been developed as part of the FAIR24RS training program created by the RSE team at the University of Sheffield.
This course on Code Design introduces essential principles and best practices for writing clean, maintainable, and efficient code. It will introduce some standard design patterns that are useful to make your code more generic and maintainable and that will make your life easier as your code base grows. We will begin with the importance of good code design and examine some examples of non-optimally written code, trying to identify where we could make improvements. Focusing on Python language, we will look at how to create functions, classes and see how to organise a source code. We will then learn how we can write clean code, adhering to naming conventions, commenting, and following PEP 8 guidelines.
The end of the training will be dedicated to learning how to leave your code in peace while still be able to modify it: configuration file and command line interfaces.
This course is aimed at researchers, including postgraduate research students, who write software (whether a few scripts or something more substantial) as part of their research and who want to follow best practices to make their code easier to read and maintain. This course is intended for researchers who use the Python programming language, but the basic concepts can be applied to other programming languages.
Basic knowledge of Python is required for this course.