Skip to main content

CSC 151.03, Class 06: Pair programming

Overview

  • Preliminaries
    • Notes and news
    • Upcoming work
    • Extra credit
    • Questions
  • Basics of pair programming
  • Benefits of pair programming
  • Exercise
  • Forming a code of conduct
  • Assorted other issues

News / Etc.

  • New places/partners!

Upcoming Work

  • Writeup for class 5 due TONIGHT at 10:30 p.m.
  • Flash cards for classes 1-6 due TONIGHT at 8:00 p.m.
    • To: rebelsky@grinnell.edu
    • Subject: CSC 151-03 Flash Cards Week 2
    • We’ll talk about them at the end of the preliminaries.
  • Writeup for class 6 due Friday at 10:30 p.m.
    • Q1: One new thing you learned about pair programming today.
    • Q2: Something you’d like to see in the class code of conduct.
    • To: csc151-03-grader@grinnell.edu
    • Subject: CSC 151.03 Writeup 6 (YOUR NAMES)
  • Assignment 3 due next Tuesday.
    • Your partner from today’s class is your partner for the assignment.
  • Read: Documenting your procedures for Friday’s class. (Not yet ready.)

Extra credit (Academic)

  • Convocation, Thurday at 11:00 a.m. in JRC 101: The Des Moines Agricultural Corridor.
    • Why you should attend every convocation.
  • Rosenfield symposium, this week. (Lots of different events)
    • Jason Reblando, photographer and author, describing “New Deal Utopias,” at 4 p.m. TODAY in JRC 101.
    • Alan Durning of Sightline Institute, stressing “The Power of Small: How Building Small Means Living Large,” 7:30 p.m. TODAY in JRC 101
    • Shu-Yang Lin, re:architect at Public Digital Innovation Space, presenting “Democracy from the Future: Taiwan” at 4 p.m. Thursday, Sept. 7 in JRC 101.
    • Tom Vilsack, former Iowa Governer, “Food as a Political Movement that Unites but Does Not Divide” at 7:30 p.m. Thursday, Sept. 7 in JRC 101.

Extra credit (Peer)

  • Women’s Soccer vs. Central, TODAY at 5:00 p.m., Springer Field
  • Women’s Soccer vs. University of Wisconsin-Oshkosh, Sunday at 1:00 p.m., Springer Field

Extra Credit (Misc)

  • Host a prospie! [ohc]
  • CS Department Picnic

Other Good Things

  • Les Duke Cross Country Meet, Saturday at 9 a.m., Country Club
  • Women’s Tennis vs. Beloit and Lake Forest, Saturday at 9 am Fieldhouse
  • Men’s Soccer vs. North Central College, Saturday at 1:00 p.m., Springer Field

Flash Cards

What’s a flash card?

  • A simple study aid.
  • A short question on one side; a short answer on the other.

Examples

  • “Scheme for add 2 and 3” => (+ 2 3)
  • ”(+ 2 3)?” => 5
  • “Typical lambda form” => (lambda (x) expression)
  • Parameters to reduce => binary operation, list of values.
  • Purpose of reduce => Reduce all the values in a list to a single value by combining neighboring values with the binop.
  • (reduce + (list 1 2 3)) => 6
  • reduce vs map1 => Same parameters. reduce reduces to single value by combining neighboring terms. map makes another list.
  • Seven parts of algorithms => Basic ops, variables, subroutines, conditionals, etc.
  • Four questions about each new type => …

Background

  • For a number of years, I’ve recommended that students use flash cards to study for CSC 151.
  • This summer, I participated in a workshop on using Cognitive Science principles in the classroom. That workshop presented evidence that flashcards are one of the more successful ways that students learn.
    • Low impact quizzes are another.
  • So I committed to requiring flashcards in this class.

Your task

  • Create at least ten flash cards for the past week (Friday, Monday, Wednesday) and turn them in by 8:00 p.m. on Wednesday night.
  • I would prefer that you create an Anki deck and download it and email it to me.
  • If you would prefer to give me a stack of ten physical flash cards at the end of class, or to email me a list of ten questions/answers.

Questions

I could not figure out how to bound all of the values in a list. What
should I have written?
Single value: (min (max value 0) 100)
Process: First I’m comparing the value to 0 and sending any value less than 0 to 0. Next I’m comparing that result to 100 and sending any value greater than 100 to 100.
I’m doing something to every element in a list, that’s map or map1. I’m using max, which is a binary procedure, so I use map.
I know that I want (map max values ???)
Since map needs one procedure and otherwise lists, ??? should be a list. Probably a list of 0’s. Hey! I just did something similar to add 1.5 to each element of the list.
(map max values (make-list 10 0)).

In code

> values
'(5 1 2 1000 923 -345 11 66 109 -1)
> (map min (map max values (make-list 10 0 )) (make-list 10 100))
'(5 1 2 100 100 0 11 66 100 0)

Observations

  • The way we did it in class Monday is probably more efficient. (map (o (section max <> 0) (section min <> 100)) values)
    • That is, the computer may spend more effort on making three lists than on making one list.
  • Don’t assume ten values (map min (map max values (make-list (length values) 0)) (make-list (length values) 100))
Since I couldn’t figure it out, what should I have done for the writeup?
Use “we” rather than “I”.
“Here’s the best we could come up with. Here’s what we were thinking. It didn’t work.”
Why won’t index-of work?
I don’t know.
You needed to (require csc151/lists)
You needed to have updated the package recently
I’ll look at one of your workstations during class.
What do we do for extra credit
Attend the event. (Doesn’t count if it’s your event. Sorry.)
Send me an email entitled “CSC 151.03 Extra Credit (Your Name)”
The body of the email describes your reactions to the event.
Within two days. (Not a hard deadline.)

Basics of pair programming

Suppose the rest of the class had not done the reading. Explain what pair programming is.

  • A method of programming with programmering with a driver and a navigator. They often switch.
  • The driver is at the computer, programming.
  • The navigator is directing at a higher level.
  • E.g., navigator says “We should probably compute the average value in that list” Driver types (/ (reduce + lst) (length lst)).
  • Navigator also looks for mistakes.
  • Navigator can help look at alternatives (as can the driver)
  • Navigator also serves as reference manual for driver.

Benefits of pair programming

Suppose the rest of the class had not done the reading. Suggest benefits.

  • Industry: Experience suggests that a pair gives more than twice the value of an individual.
  • Dynamic and static environments.
  • Being in two roles is helpful. Sometimes you should be thinking about big picture, sometimes you should he thinking about code.
  • “Pair pressure” - Self Gov means that you feel more responsibility to your partner than you feel to yourself.
  • Looking at bigger picture is helpful. Beats code and fix.
  • Meet new (usually) awesome people.
  • Prepare for real life, when you will work with others, even in non-pair situations.

Exercise

Many of you have received a card that includes something a CS student has said or suggested about their experience in 151. Please read those aloud. Afterwards, we will discuss what you heard and think about implications.

We’ll start with two that many people seemed to laugh at (perhaps nervously).

“My partner is never able to work on Saturday. I don’t get it.”

  • Could be a partner who just wants to shut down on Saturday and is not willing to acknowledge their responsibility to their partner.
  • Some people have religious obligations on Saturday.
  • Some people may have to work all day Saturday.

“I was happy when partner asked me to work on the project together because we’d done well on homework. Then they asked me out.”

  • Feels really uncomfortable.
  • Undermines confidence.

“I didn’t realize people can be so mean.”

  • I don’t think that most of them intend to be.
  • Most of you are not jerks; let’s not assume they are.

What do we do when the two partners have different levels of expertise or confidence or …?

  • You learn from helping.
  • Confidence can be misplaced.

Then we’ll look more generally at things you heard/thought/etc.

Forming a code of conduct

  • I will treat my partner with respect.
  • I will do my best to understand my partners strengths and not criticize them for what I perceive as weaknesses. Assorted other issues ———————

A chance to talk about leftover things.