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.

Before we begin with the class:

Test

(20 min)

Accept the assignment

Homework review

Max number finder

Tabular output

Array of symbols

Similar: Square array of symbols

Factorial

Preparation review

Learning goals

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:

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

Group formation facilitation

Working with a different partner each time helps you:

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

Source by VenkatRaman2