The learning goals for Week 38 are:
Mon (at 8.15): State Pattern. Mandatory hints. Wed: Clean Code. Maintainability and Flexibility. (Screencasted only)
Literature:
Slides:
Notes for this weekplan:
The Monday lecture (at 8.15) will cover the State Pattern and next provide hints and advice for the mandatory project.
Wednesday lectures are cancelled as physical lectures, and replaced by screencasts.
The topic of Clean Code is a main topic of this week, but will purely be based upon screencasts. The theory and practices will be exemplified through my refactoring/cleaning up of the HotStone 'attackCard(...)' method. You may study the StandardGame.java yourself before watching the screencasts. The reason for not doing the clean code lectures live is that A) it is a complex code base so refactoring it live easily goes wrong and B) it allows you to skip repetitious tasks like session 'doing more bail out fast'.
The Clean Code presentations consist of
- Session 0 / Clean Code slides (52min) (same as the 'W4-1' screencast above)
- ... on to the actual live coding, presented in the following sessions:
- Session 1 / Do not repeat yourself (11.40)
- Session 2 / Bail out fast (6.30)
- Session 3 / Bail out fast (6.30)
- Session 4 / Do one thing (6.30)
- Session 5 / One level of abstraction (9.30)
- Session 6 / One level of abstraction (5.50)
Links to the Clean Code Classification Template
Additional exercises:
Find Dirty Code
Find some code from previous courses or projects, and analyze them according to the Uncle Bob+Henrik principles. If in the mood - clean them up.
Exam Rehearsal
Rehearse a clean code exam situation. Spend 20-25 minutes to prepare a 10 minute oral presentation of an exercise in the example exam question set: demo-question-final-2023.pdf.
Next, do a 10 minute presentation at the whiteboard in front of your team.
The team provides constructive feedback on the presentation: Is your presentation clear and understandable, do you discuss the concepts and terms correctly, is you Java example code correct, etc. Swap and ensure all in the team gets a chance to rehearse the situation.
Legend: The typography bold, normal, (brackets), above indicate my perception of how important the exercises are from high to optional. However, solve the mandatory project first!