EBoard 11: Pair programming (Section 3)
Warning! You are being recorded and transcribed, provided the technology
is working correctly.
We are back to the standard start-of-class procedure.
Approximate optimistic overview
- Administrative stuff [10 min]
- Some notes on tracing [10 min]
- Questions and answers [5 min]
- An exercise [20 min]
- Reflections on the readings and broader issues [20 min]
- Lab and turn in [15 min]
Administrative stuff
Introductory notes
- Happy Junior Visit Day! I don’t know if we’ll have any visitors.
- I have last Friday’s quizzes mostly graded, but not yet uploaded to
Gradescope. Expect to see them tonight.
- Thank you for making it to class on such a cold day!
- Because I care about you, I brought you (discounted) Valentine’s day
candy.
Upcoming activities
Scholarly
- Tuesday, 18 February 2025, Noon–12:50 p.m., PDR 224C (White Dining Room).
CS Table: The Attention Age
- Thursday, 20 February 2025, 11:00 a.m.–noon, JRC 101.
Scholars’ Convocation: Steven Geofrey. What Information Worlds Reveal about Climate Change Awareness, Advocacy, and Hope
Artistic
Multicultural
- Friday, 21 February 2025, 4:00–5:00 p.m., HSSC N1170 (Global Living Room).
Middle of Everywhere: ???
Peer
Musical, theatric, sporting, and academic events involving this section’s
students are welcome.
Wellness
- Tuesday, 18 February 2025, 12:15–12:50 p.m., GCMoA.
Yoga in the Museum.
- Tuesday, 18 February 2025, 5:00–6:00 p.m., HSSC S1003 (Atrium).
Therapy Dogs.
- Tuesday, 18 February 2025, 4:30–6:30 p.m.,
BRAC P103 (Multipurpose Dance Studio).
Wellness Yoga.
- Tuesday, 18 February 2025, 7:15–8:15 p.m., HSSC S1003 (Atrium).
Therapy Dogs.
Misc
- Tuesday, 18 February 2025, 7:00–8:00 p.m., Science 3820.
Mentor Session (Quiz prep for Documentation Quiz; Review Tracing)
- Sunday, 23 February 2025, 7:30–8:30 p.m., Science 3819.
Mentor Session
Other good things
These do not earn tokens, but are worth your consideration.
- Monday, 17 February 2025, 8:00–10:00 p.m., Bob’s Underground.
Open Mic Night.
Upcoming work
- Monday, 17 February 2025
- SoLA 1 released at 4:00 p.m.
- Late submission of MP3
- Tuesday, 18 February 2025
- Wednesday, 19 February 2025
- Quiz: Documentation
- Makeup quiz: Tracing
- Thursday, 20 February 2025
- Submit Wednesday’s lab on Gradescope
- Readings:
- SoLA 1
- Friday, 21 February 2025
- Sunday, 23 February 2025
Notes on the tracing quiz
Please read the notes on your quiz, even if you got credit.
Do things one step at a time
NO:
(+ (* 2 3) (* 4 5))
--> (+ 6 20)
YES:
(+ (* 2 3) (* 4 5))
--> (+ 6 (* 4 5))
--> (+ 6 20)
Expand all procedures, even ones in which you think you know the result
NO:
(+ 5 (square 9))
--> (+ 5 81)
YES:
(+ 5 (square 9))
--> (+ 5 (* 9 9))
--> (+ 5 81)
Finish evaluating each expression before moving on to the next
NO:
(+ (square (* 2 3)) (square (* 4 5)))
--> (+ (square 6) (square (* 4 5)))
--> (+ (square 6) (square 20))
YES:
(+ (square (* 2 3)) (square (* 4 5)))
--> (+ (square 6) (square (* 4 5)))
--> (+ (* 6 6) (square (* 4 5)))
--> (+ 36 (square (* 4 5)))
--> (+ 36 (square 20))
Evaluate expressions left-to-right (and inside-out)
NO
(+ (square (* 2 3)) (square (* 4 5)))
--> (+ (square (* 2 3)) (square 20)
YES
(+ (square (* 2 3)) (square (* 4 5)))`
--> (+ (square 6) (square (* 4 5)))
Remember how subtraction works
NO
(+ (- 10 4) (- 2 9))
--> (+ -6 (- 2 9))
--> (+ -6 7)
YES
(+ (- 10 4) (- 2 9))
--> (+ 6 (- 2 9))
--> (+ 6 -7)
Don’t parenthesize numbers
NO
(+ 6 (- 2 9))
--> (+ 6 (-7))
YES
(+ 6 (- 2 9))
--> (+ 6 -7)
Note: Your goal is to keep the expression as valid Scheme the whole way.
Keep the whole context at all times
NO
(+ (square (+ 2 3)) (square (+ 3 4)))
--> (square (+ 2 3))
--> (square 5)
--> (* 5 5)
--> 25
--> (+ 25 (square (+ 3 4)))
YES
(+ (square (+ 2 3)) (square (+ 3 4)))
--> (+ (square 5) (square (+ 3 4)))
--> (+ (* 5 5) (square (+ 3 4)))
--> (+ 25 (square (+ 3 4)))
Questions
Administrative
SoLAs
Is “Procedural Abstraction” just a long name for “Procedures”?
Yes.
Do we have to know conditionals?
Not for this SoLA. I’ll fix the page soon.
Background
- Today is our “talk about pair programming” day.
- In our experience, partnering works imperfectly.
- Some students tend to dominate and are impatient with their partners.
- Some students feel like they don’t know enough and don’t want to
“hold their partner back”.
- We use this day to help make partnering better.
- We will return to these issues throughout the semester.
An exercise
TPS:
- 1 min: Think to yourself for a minute. What did you hear? What would
you like to talk about? What made you optimistic? What surprised you?
What worried you? What sounded familiar?
- 3 min: Talk to your partner about it
- n min: Full class consideration
What do we want to talk about?
- Pair programming is better (see reading on details). We generally
engage more in pairs.
- There are benefits even if you “know more”; you learn by explaining.
(You also learn from different ideas or approaches.)
- The challenges of partnering as someone who is non-neurotypical.
- It’s frustrating that people see you as not competent when you are
competent (particularly when they are not).
What should you do if you ask your partner for help, they try to help,
and you’re still confused?
- You could ask one of the course staff (mentor or professor).
- You shouldn’t be embarrassed to ask questions. If your partner gets
upset, it’s their problem, not yours.
- Make a choice: Will you benefit more for delving into that topic right
now, or will you possibly learn more going on in the lab? In some cases,
it may be worth going on.
- Note: You should be patient with your partner if they are in this
situation.
How can you be a better partner (whether you are in the “I know more”
camp or in the “I’m afraid I’m holding my partner back” camp)?
- Ask questions when you’re not sure.
- Also ask “Why did you choose to do this” style questions.
- Make suggestions.
- Be explicitly appreciative. “It was great working with you.” Or
“Thanks for that idea”.
- Remember that helping your partner helps yourself.
- Be prepared.
- Be understanding when your partner is not prepared (or even not engaged).
Reflecting on the readings (TPS)
What are the key points from the readings? (TPS)
Pair Programming
- Two core roles: Driver and navigator. It’s important to rotate roles.
- In large projects, it’s important to switch pairs regularly so that you
get fresh eyes on things. Also so that you get experiences working with
people with different perspectives.
- Although it seems inefficient to have two people work on the same code
together, if it’s done right, it results in better code (often done
more efficiently).
- When you’re stuck, explaining what you’re doing to a rubber duck will
help you find issues. Explaining to a real live human being is even better.
Couch Potatoes and Hitchhikers
- You want neither speeders (let’s get everything done quickly) nor hitchhikers
(just watching, not doing). Switching A and B helps.
- “Reflect back on the CP&Hs” (Hmmm … we’re not sure we understand or agree.)
- In the long term, neither the hitchhiker nor the bus driver benefit from
the arrangement; the bus driver does more work, the hitchhiker learns
less. It’s hard, but it’s important to raise these issues when they come
up, rather than to wait.
- Try to solve the problem amongst yourselves. But if that doesn’t work,
bring it up with the class mentor or instructor.
Diverse teams
- Diverse experiences make pair programming and group work better.
- Being open makes pair programming and group work better.
- It’s important to consider what other people bring to the table.
- These can be hard to work in - people have different backgrounds, skills,
ways to approach problems. Those different ideas will create a better
output in the end. If everyone thinks about it the same, you won’t
consider enough alternates.
- There’s some value in discomfort. Be open to being a little uncomfortable.
Aim for the ZPD!
Lab