Week 9: Clean Code (QA)
Goal
This week’s goal is to learn by doing, practice clean code, design, and refactoring patterns on real code while internalizing the concepts and your team’s own coding commitments.
Expected Results Before This Week
Weekly Progress Check rules
- Be prepared to show your results at the beginning of class.
- Presenting teams are selected randomly each week. The same team may be selected repeatedly.
- If your team is selected and there is no relevant work recorded before the session, 3 points will be deducted. Any relevant demonstrable work avoids the deduction: the weekly score is then between 0 and +3 points, depending on quality and completeness.
- A missing expected result can cause a point deduction only once, but you should still catch up: later work may depend on it, and these results usually contribute to the tasks required for your desired grade. More about salary for tasks
How Weekly Progress Checks work · More about penalty and bonus points
This week's expected results
- Make sure your repository contains enough working source code to inspect and improve during the session: as a rough minimum, have at least one implemented feature or class with around 4–5 meaningful methods. Someone in the team must be able to explain what a randomly selected part of this code does, why it was implemented that way, and how it fits into the project; code that nobody can explain does not count as a useful starting point.
- Collect at least one example of your own previous code that you are proud of, preferably from the current project but it may come from elsewhere. Record the code or a link to it somewhere traceable in the GitLab project—such as an issue, Markdown note, or wiki page—and briefly explain what makes it a good example and what circumstances or decisions helped produce that result.
- Collect at least one example of your own previous code that you are not proud of, again preferably from the current project but it may come from elsewhere. Record it in the same traceable way and briefly explain what circumstances, constraints, shortcuts, or decisions led to that result and what you would do differently now. The purpose is not public shaming, but to recognize patterns that can lead to worse code and learn how to avoid them in future work.
Notes for tutors:
1: Code For Humans
Why is this useful for me?
Things you learn and experience in this session will help you to solve the following tasks:
Background
- Clean Code Matters
- https://refactoring.guru/
- https://www.oreilly.com/library/view/clean-code-a/9780136083238/
- Negative examples and jokes: https://cs.fit.edu/~kgallagher/Schtick/How%20To%20Write%20Unmaintainable%20Code.html
Activities
- Discuss what "WTF/min" and "Any fool can write code that a computer can understand. Good programmers write code that humans can understand." (Martin Fowler)
2: My Zen of Python
Activities
- Explain which Zen of Python points are most relevant to you personally? Discuss it with the tutor and other students.
3: The Feeling I Leave in Code
Activities
- Write one sentence that expresses how you want future developers to feel when they read and work with your code. It should be just one sentence starting with “I wish future developers feel…” to express and justify the emotion or impression you want your code to inspire. Discuss it with the tutor and other students.
4: When and How to Refactor
Why is this useful for me?
Things you learn and experience in this session will help you to solve the following tasks: