Summary and Schedule
This is a Byte-Sized RSE lesson on code style, quality & linting, part of the Byte-Sized RSE Series.
Learning Objectives
At the end of this lesson, learners should be able to:
- Explain why consistent code style is important for collaboration and long-term maintainability.
- Identify key code style practices and how they vary between programming languages.
- Recognise how maintaining good code style can reduce bugs and improve code quality.
- Explain what a linter is and describe its role in detecting errors and enforcing style.
- Perform automated code style checking and static code analysis with Pylint.
| Setup Instructions | Download files required for the lesson | |
| Duration: 00h 00m | 1. Introduction |
Why does consistent code style matter in software development? What are some common code styling practices and conventions? How can poor coding style lead to bugs and maintenance issues? What is a linter, and how does it help improve code quality? |
| Duration: 00h 15m | 2. Example Code |
Why should I write readable code? What is a “code smell”? |
| Duration: 00h 25m | 3. Analysing Code using a Linter |
What tools can help with maintaining a consistent code style? How can I keep dependencies between different code projects separate? How can we automate code style checking? |
| Duration: 00h 35m | 4. Advanced Linting Features |
What can I do to increase the detail of Pylint reports? How can I reduce unwanted messages from Pylint? How can I use static code analysis tools within VSCode? |
| Duration: 00h 45m | Finish |
The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.
Setup
- Shell with Git version control tool installed
- Ability to navigate filesystem and run commands from within a shell
- Python version 3.8 or above installed
- Understanding of Python syntax to be able to read and follow code examples
- Pip Python package installer
- Visual Studio Code installed (ideally the latest version)
Shell with Git
On macOS and Linux, some version of a shell (e.g. bash)
with Git will be available by default and no installation is needed.
If you do not have a bash shell installed on your system and require assistance with the installation, you can take a look at the instructions provided by Software Carpentry for installing shell and Git.
Python
Python version 3.8 or above is required. Type python -v
at your shell prompt and press enter to see what version of Python is
installed on your system. If you do not have Python installed on your
system and require assistance with the installation, you can take a look
at the
instructions provided by Software Carpentry for installing Python in
preparation for undertaking their Python lesson.