EBoard 08: Pair programming

Approximate overview

  • Administrative stuff + Q&A [20-30 min]
  • Discussion, part one [20 min]
  • Discussion, part two [remaining time]
  • Images!

Administrative stuff

Introductory Notes

  • I hope you had a good weekend!
  • Even with going far beyond my 40-hour cap, I’m not caught up yet.

Upcoming activities

Events

  • Mentor session Tuesday 8pm
  • Mentor sessions Wednesday 7pm

Upcoming work

Some notes from Friday’s lab

  • (define is-even? (lambda (x) (if (zero? (remainder x 2)) #t #f))) is correct but also inelegant.
    • Refer back to foo/bar.
    • (if TEST #t #f) is a long way to write TEST.
    • (define is-even? (lambda (x) (zero? (remainder x 2))))
    • Note: We will occasionally ask you to re-implement built-in functions to deepen your understanding.
  • (define is-even-integer? (lambda (x) (if (integer? x) (if (zero? (remainder x 2) #t #f)) #f))) is also both correct and inelegant.
    • Use is-even? rather than repeating its body.
    • (define is-even-integer? (lambda (x) (if (integer? x) (is-even? x) #f)))
    • Refer back to baz/qux for simplification.
    • (define is-even-integer? (lambda (x) (and (integer? x) (is-even? x))))
    • What do you think of
      (define is-even-integer? (lambda (x) (and (is-even? x) (integer? x))))
    • Note also that the order of testing is important. If you don’t input an integer, this will still give an error message.
  • You can write median-of-3 without conditionals
    (define median-of-3 (lambda (x y z) (- (+ x y z) (min x y z) (max x y z))))
  • Challenge: Can you write both-even? with only one call to is-even? (and no calls to remainder)?
    • As in (define (both-even? x y) (is-even? (some-function-of x y))).

Mini-Project 1 Returned

  • Notes on the grading scale: To earn E, you must have code that is nearly perfect, something that I would feel comfortable handing out to other students and saying “This is what you should do.”
    • Sometimes a few small things will keep you from E.
    • But you can redo the assignment, just fixing those.
  • Notes on the grading: Graders are still learning.
  • Some notes on grading on Gradescope.
    • I hope you heard all that.
    • Please look at comments from graders, interspersed in code.
    • Please read the output from the (incomplete) autograder; ask questions if it doesn’t make sense.
    • Please read the manual (human grader) comments and checklist.

Q&A

My computer is not starting

Ask a mentor.

What goes in the citations section?

The names or descriptions of people you talked to who provided assistance “Eamon”, “The Sunday evening tutor”, “My partner on lab 5”, “Some random person who was in the lab on Saturday evening.”

Pages you looked at while doing the assignment. A URL suffices.

Will graders indicate minor improvements?

Sometimes.

Sometimes Sam will raise them in class.

If there’s time at mentor sessions, you might be able to get feedback there.

Evening tutors are sometimes bored. Ask them.

Where do we find tokens?

Sam will send you info from time to time.

Can we ask you, too?

Sure, but I’m not always up to date in my recording.

How do we resubmit?

If you go to Gradescope, you should see a link for “MP1 Redo”. Use that.

Eventually, there may even be an “MP1 Second Redo”.

When is the redo due?

Sunday

I don’t see a link to today’s labs on the schedule

Try reloading.

Pair Programming

Think -> Pair -> Share

  • Hopefully, you thought about the readings already.
  • Discuss with your partner.
    • What is something surprising or interesting you took from the readings?
    • What are some important lessons about pair programming (or related issues) that you took from the readings for today?
  • Go to the first lab for today (linked on the schedule) and fill in the questions.
  • Be prepared to discuss.

Something surprising

  • Partners help you pay more attention to details.
  • Partners help you think about different ways to approach a problem.
  • Whoops. There are also negative aspects?
    • Couch potatoes
    • Overpowering partners
  • You learn by teaching. Questions get you out of your comfort zone. Explaining also helps.
  • Breaks are good. This is important!
  • While rubber plants are useful, human beings are more useful.
    • Explaining your code and approaches helps you avoid mistakes
    • It works with inanimate objects
    • It works better with animate objects, especially since they ask question.

Important lessons

  • Clean coding is important; pairing sets guidelines.
  • Partnering slows you down; think, don’t just make a quick fix and hit run.
  • Navigator should be looking at higher-level issues.
    • In our class, there’s benefit to the navigator also serving as a reference. (Particularly if you have multiple screens.)
  • Ctrl-up-arrow gives you the previous line of code. (Esc-P does too.)
  • Set expectations with you partner!
  • You learn together.

Pair Programming in Practice

  • You should have received a card from Sam or one of the mentors.
  • These represent approximate quotations from past CSC-151 students (anywhere from midway through the semester to a few years after they took CSC-151).
  • I will ask you to read them aloud so that you hear them in the voices of students.
  • Listen carefully for comments that resonate or that you’d like to discuss further.
  • We will think, pair, and share.

Comments

  • Experience suggests that hearing these comments and discussing them helps make us better partners (and, we hope, better people).
  • “My partner can never work on Saturday.”
    • Some people try to manage their schedule so that they have a gap from schoolwork. Or they may have work.
    • Some religious groups treat Saturday or Sunday as the sabbath.
    • Some teams regularly have meets or practices on Saturdays.
  • “I thought we were working well together. Then my partner asked me out.”
    • Presents a conflict of interest, particularly if the interest is not reciprocated.
    • Crosses a boundary. This is academic life, not personal.
    • Could exploit a power imbalance.
    • Undermines your partner’s self confidence.
  • “Did someone really call their partner the B word?”
  • Partners need to communicate and know differences.
  • Respect differences; try to learn about them.
  • Being prepared is important.
  • Making assumptions based on appearance.

Class Code of Conduct

As I hope you heard, there are many positives to pair programming, but there are also pitfalls. What can we decide about behavior as a class that will help us work better together?

Think -> Pair -> Record

Sam will share in a future class or via email