Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

A pattern consisting of 80 lines. You will later draw it as .

A pattern consisting of 80 lines. You will later draw it as Exercise 7.

Before we begin with the class:

Test

(20 min)

Accept the assignment

Preparation review

Pair programming

Learning goals:

Two people, one computer, one problem. We have two roles: driver who codes and the navigator who supports.

Source: Teaching Programming, MIT license

Why?

  1. Explaining is how you learn. Programmers even explain their code to a rubber duck, if noone is around.

  2. Pairing is especially helpful for students with less prior experience.

  3. More experienced students profit by being forced to slow down and think about what their code does and why.

  4. 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

Source: https://github.com/BrOrlandi/btimer

Learning goals

Coding - Decision Structures and Boolean Logic

E: Ordering ids

E: Day of the week

E: Friends’ dietary requirements

Temperature check 🌡️

How do you feel with the concepts we introduced so far? 📊 Live poll

  1. I feel confident and ready to move on at similar pace by introducing new concepts.

  2. I would rather have more exercises and less introduction of new topics.

  3. I don’t know

Coding - Repetition

E: Bug collector

See book ch4 p.255 Exercise 1

E: Sum of numbers

See book ch4 p.256 Exercise 8

E: Pattern using nested loops

See book ch4 p.258 Exercise 13

E: Drawing repeating squares

See book ch4 p.258 Exercise 15

E: Reflection

Source by VenkatRaman2

Source by VenkatRaman2