Session 03 2º
Member Guide: coding the club rules
We go through The Dev Hub Member Guide together and finish with a mob programming exercise: the group dictates while we live-code a rule-breach evaluator in Python.
Member Guide: coding the club rules
Today's session runs a little longer than usual. We go through The Dev Hub Member Guide and, at the end, turn it into code together.
1. Guide walkthrough
- What we expect from you: regular attendance, taking part, asking without fear, helping by explaining and being honest about your work.
- What we do not tolerate: harassment, discrimination, making fun of someone's level, sharing images without permission, cheating or using AI where it is not allowed, malware and attacks on systems.
- If something goes wrong: who to tell and what you can expect from the club.
- What happens if the rules are broken: minor, serious and very serious offences.
- Your academic credit: 1 credit per year if you are an active member and follow the guide.
- Annex: use of AI (point 4), projects (point 5) and name and image (point 6).
2. Questions
Is there anything unclear, or anything you think is missing from the guide?
3. Exercise: coding the guide
How it works (mob programming)
- Driver: types on screen only what the group dictates.
- Navigators: everyone else. You decide the logic, the names and the structure.
- Every 5–7 minutes the lead navigator, who does the dictating, changes.
- No AI: this is an internal activity (Annex, point 4).
Challenge
Write a Python program that, given a behaviour, returns its severity and its consequence according to the guide.
- Decide how to represent offences (a dictionary?
if/elif?). - Write
evaluar(falta, reincidente). A repeated minor offence becomes serious. - Test it with the cases below.
- Bonus: write
puede_optar_credito(...).
Starting point
def evaluar(falta, reincidente=False):
# Returns the severity and consequence of the offence
pass
def puede_optar_credito(miembro_activo, expulsado):
# Is the member eligible for this year's academic credit?
pass
Test cases
We first discuss the answer out loud, then check whether the code agrees.
| Case | Severity? |
|---|---|
| Watching a YouTube video during a session, once | ? |
| Doing it again the following week | ? |
| Using ChatGPT in an internal challenge | ? |
| Posting a screenshot of the club chat with other people's names on social media | ? |
| Trying to get into a university system without permission "just to test it" | ? |
| Laughing at a classmate's question | 🤔 Discuss |
4. Wrap-up
Which offence was hardest to code, and why? Turning human rules into logic forces you to decide the edge cases, just like any other programming task.