Welcome 🤗! In the next ~4h we will cover:

Pair programming. Source: Teaching Programming, MIT license
Before we begin with the class:
Er der to af jer, der vil være Feedback persons?
Hvis du har mistet et eller flere forsøg, skulle du have modtaget en mail
Feedback: frigiv hjemmearbejde mindst en uge før afleveringstiden. Hvem har brug for det?
jeg vil prøve at afsætte længere tid til jeres øvelser og gennemgå min egne løsning. (feedback)
Test¶
(20 min)
Homework review¶
Max number finder¶
Tabular output¶
Array of symbols¶
Similar: Square array of symbols
Factorial¶
Preparation review¶
Learning goals¶
Recognize common mistakes in control statements and fix them.
Trace a short program out loud and predict its output.
Use
forloops to generate sequences of numbers and graphical patterns.
E: Finding errors in control statements¶
Before we get into coding, let us warm up with the new syntax we just got into our hands 🪛.
Pair programming¶
Pair programming¶
Learning goals:
Describe the responsibilities of the driver and the navigator, and when to switch
Act as driver by narrating what you are typing and why
Act as navigator by asking guiding questions and catching mistakes without taking over the keyboard
Give your partner constructive feedback and reflect on what you learned from them
Two people, one computer, one problem. We have two roles: driver who codes and the navigator who supports.

Source: Teaching Programming, MIT license
Why?
Explaining is how you learn. Programmers even explain their code to a rubber duck, if noone is around.
Pairing is especially helpful for students with less prior experience.
More experienced students profit by being forced to slow down and think about what their code does and why.
This is a workplace skill. Pair programming comes from professional software teams.
⌨️ Driver
Types the code
Focuses on the syntax and immediate line
Dictates what she/he is doing and why.
🧭 Navigator
Doesn’t touch the keyboard
Ask questions rather than making demands.
Thinks about the bigger picture — logic, bugs, what’s next
Asks questions, catches mistakes, suggests ideas
What if a group of 3?
Still one driver, and this role rotates.
Multiple navigators. They do the same job.
Rules
Commit for at least 1 hour.
Switch roles every 10 minutes.
Talk out loud, constantly.
Navigator doesn’t grab the keyboard. If you see a typo, say it.
Be kind.
❌ do not: You’re doing that wrong
✅ instead: What if we tried?
Before you start
Read the problem together out loud.
Agree on a plan before any code gets written.
The 🟥 red color or the lower number drives first.
If you get stuck
Navigator: ask a question instead of giving the answer.
Still stuck after few minutes? Raise a hand for help 🤚.
At the end
Ask each other:
What did you learn from your partner?
What would you do differently next time?
For the teacher/TA
Stop the time for two first one-two times.
Check that the driver role is rotating.
Making sure that groups don’t go silent.
Watch for a student who never speaks; ask a low stakes question to the group rather than singling them out.
Timer¶
Group formation facilitation¶
Working with a different partner each time helps you:
see how someone else approaches a problem
get to know your peers
help others in our learning community.
The instructor/TA will facilitate group formation. Participation is optional.
Pick one of the three spots in the front:
🟪 Left: Pair programming
You shift between driver and navigator.
🔷 Middle: Tutoring (helper)
I’d like to help someone who is learning.
🟡 Right: Tutoring (learner)
I’d like help from someone more experienced.
If there are more learners than helpers, we may form groups of three, or you can pair-program instead.
Coding¶
Sequences¶
X pattern¶
Fizz Buzz¶
E: Reflection¶

Source by VenkatRaman2