Eboard 01 (Section 2): Getting started

You are probably being recorded (and transcribed) (if the technology is working correctly).

Start of class instructions

  • Optional: Grab a mask
  • Optional: Grab a Nutrigrain bar
  • Grab one of the business cards that have computer names and locations.
  • Identify where the corresponding computer is.
  • Return the card to the jar.
  • Navigate to the computer.
  • When both partners arrive, introduce yourselves.

Greetings

  • Welcome to CSC207!
  • I’m Sam (or SamR).
  • Our class mentor is Garikai Gijima.

Approximate overview

  • Preliminaries
    • Notes and news
    • Upcoming work
    • Extra credit
    • Questions
  • Course goals
  • Course structure
  • ADTs and data structures
  • Designing a stack ADT (an exercise)
  • Implementing our stack ADT (an exercise) If time permits.
  • Designing an array ADT (another exercise) If time permits.

Preliminaries

  • Consider grabbing a mask.
  • You should know the “pick a card, find a place” process.
  • If you don’t know the people near you, please introduce yourselves.

News / Etc.

  • We’ll be using two “books” for this course: The readings I write (or wrote) and CLRS.
  • I type class notes in markdown and post to the Web site.
    • It’s like magic (I hope).
    • At least I hope it does.
  • You will find that I call on students randomly using a set of cards with your names on them.
    • I use this process to give you practice “thinking on your seat”, as it were.
    • I also use this process to help everyone realize that they are not the only one who is puzzled.
    • And I use the process to push you a bit.
    • Feel free to say “I’m not sure” or “I’d prefer not to answer.”
    • If you don’t want to be called on in class, please let me know.
  • We are a community. Treat each other with respect. If you (think you) know more than your partner, support, don’t overwhelm.
  • Sam is facing some personal issues. There may be some hiccups in the class.

Upcoming work

Tokens

I don’t know what your prior experience with tokens is. I give them for academic/scholarly events, cultural events, peer events, wellness events, and a few other things. Only those I record in the daily eboards are available. Please log them within three days.

If you’d like to suggest token events, please let me know in advance of class.

Academic/Scholarly

  • Thursday, 2024-08-29, 11:00 a.m., JRC 101. President Anne F. Harris - Moving Knowledge into Action: Initiatives and Actions in Year Two of the Strategic Plan.

Cultural

  • Thursday, 2024-08-29, 6:00 to 8:00 p.m., Grinnell Museum of Art and environs. Student Night at the Museum.

Multicultural

  • Friday, 2024-08-30, 4:00 to 5:00 p.m., HSSN N1170 - Global Living Room. Middle of Everywhere: Iowa.

Peer

Wellness

Misc

  • Thursday, 2024-08-29, 3:00 p.m. to 7:00 p.m., Central Park. Ag Appreciation Day.

Other good things

Thursday PSA

I historically give a “Friday PSA” (public service announcement). Students have encouraged me to continue doing so. Unfortunately, our class does not meet on Fridays, so I will pretend that we’re a state school, and give you a Thursday PSA. If you find these annoying, let your class mentor know and they’ll tell me to stop.

  • You are awesome. I would like you to remain awesome.
  • You likely have people who care about you. You should remain well for their sake, too.
  • Moderation.
  • Remember that everyone has different limits.
  • Don’t give in to peer pressure (or perceptions of peer behavior).
  • Consent is essential! It is also not sufficient.
  • Take care of yourselves.

Attendance

  • Since it’s the first day of class, I will take attendance.
    • It will take me at least a few weeks to learn all of your names.
    • For the first few weeks of class, please say your name before you ask or answer questions.
      • Please do so even if I’ve called on you by name. Even if I know your name, your classmates may not.
  • Today’s attendance protocol. When I say your name, answer as follows.
    • “Hi, my name is FORENAME SURNAME.”
    • Optional: “My pronouns are ….”
    • “You can call me PRIMARY NAME.”
    • “If you must address me by surname, you can call me Mr./Ms./Mx./Sr./Srta./etc. SURNAME [San].”
    • “This semester, I’m looking forward to ….”
    • Optional: A question

Excited about

  • This class
  • Helping students learn the CSC-207 material.
  • CSC-213, Operating Systems (ha ha, you folks can’t take it)
  • Renfrow opening
  • Make memories
  • December 20
  • Clubs to join
  • Being forced to move to the front of the classroom.
  • No 8am classes
  • Doing great at CAing [+1]
  • Improvements to Pedal Grinnell
  • Chewing GUM
  • Being treasurer for math club
  • Writing a personal project
  • Learning new programming languages
  • Pickleball
  • Teaching little impressionable critters about math
  • Being evil
  • Earning tokens
  • Working at the rock climbing wall
  • Volleyball
  • Finishing a job
  • Playing a game
  • Film Theory
  • Halloween
  • Learning about Grinnell

Questions

How was Sam’s summer?

Difficult.

Can I transfer to section 1 which meets at 8:00 a.m.?

There’s one spot left.

Can you scroll up to the questions? [+2]

Yes.

Why do we use VS Code?

Because I like torturing students.

Because I asked some folks what to use and the consensus was VS Code. “Eclipse is old hat.” “IntelliJ is commercial software.”

Does Sam have hearing loss?

Yes, particularly at the upper range. And he forgot his hearing aids today.

What is Sam’s favorite passtime?

Snark.

Spending time with family. (Board and card games.)

What’s Sam’s favorite color?

Plaid.

If you could make a video game, what would you make?

Something implicitly educational. Or maybe freeform artistic.

What movie about technology should everyone watch?

Real Genius

What is Sam’s favorite snack?

Lamejun with yogurt

Favorite board/card game?

Card: Canasta

Board: Yacht Race, Carcassonne, RoboRally, Cosmic Encounter

Least favorite color?

I am red-green color deficient. There are some shades of green that I cannot distinguish from black. I hate those shades of green.

Have you seen any good movies lately?

No.

When did you first think of becoming a professor?

Possibly in college when I was TAing because it’s amazing to see an idea click in someone’s mind and know you contributed.

Also my mom was a professor and seeing the impact she had on her students was inspirational.

Favorite food?

Fruit

Least favorite food?

Nuts, because I’m allergic.

Questions from the reading responses

Was there a reading?

Yes. It was on the schedule. I thought it was also in the email. Did you not get the email?

Could you explain the relationship between traits, mixins, and Java’s forms of polymorphism?

Perhaps after we’ve discussed Java’s forms of polymorphism.

Maybe explain the concept of Polymorphism and Inheritance, because I remember learning it from CSC 161, but have forgotten some things that I don’t remember specifically.

We’ll do those in depth in a week or two.

How should we know what strategy to choose for SAM to be efficient? It feels like we can choose anything but I don’t understand the differences until I start writing the methods.

Our goal in ADT design is not efficiency; it’s to think through how we want to use the data. What do we want to be able to do? It’s only once we look at implementations that we start thinking about costs.

How does the Layout of LIA (or the Arrangement in AAA) affect the outcome? Is there anything specific to look out for when choosing the layout for ADT?

Different layouts will lead to different costs. We should see that when we explore different implementations of stacks.

I felt sloppy answering these questions. I mostly used what I knew from C, and I had trouble envisioning how this would work in an OO environment. If you could go into more detail about these data structures are implemented in Java that would be splendid.

We haven’t done any Java or OOP yet. I wouldn’t think that you’d approach them that way. We’ll look at them as C structures or functions for the time being. We’ll return to stacks and such in an OO model in a few weeks.

How would the basic data structures we learned in 161 (stacks and queues) be implemented within Java/OOP without using pseudo-code?

We’ll cover those in a few weeks, once we’ve learned about objects (and perhaps even generics).

For the arrangement question, what were you thinking about as “other data”?

For context, that question reads “Describe a way you might arrange a stack in memory. (You might represent the stack as a linked structure or an array; what other data would you store in each case?)”

If I were storing the stack as an array in C, in addition to the array, I would also store the size of the array (I might call that the “capacity” of the stack) and the number of elements in the stack.

struct StackOfStrings {
   char **elements;
   int capacity;
   int size;
};

Although a linked implementation of stacks might only require one pointer, a linked implementation of queues often requires two (one for the front of the queue and one for the back of the queue).

I’ve read that there are 4 principles: Abstraction, Polymorphism, Encapsulation, Inheritance. The way the reading laid it out is a bit different: Encapsulation, Inheritance, Polymorphism, Composition. Especially in the Encapsulation part, it seems a bit difficult to differentiate between that and Abstraction. Can you go deeper into these 2?

Great question! Let’s wait until we’ve played with them a bit more.

If there is time maybe an example of a minimalist design ADT?

Yup, we’ll do that for stacks today.

If possible just re-explain how ADT and data structures work together

The ADT is the what. That is, what you want to do with your data. The data structure is the how. That is, how we achieve those goals.

Alternately, the ADT is the .h file and the data structure is the .c file. At least that holds if we’re thinking about collections of values.

Course goals

Get started learning how to be a computer scientist / software developer.

  • Software development
    • “Real” development tools
      • IDE (VS Code)
      • Collaborative Version Contrl System (Git)
      • Build tools (Maven)
      • Unit testing (JUnit)
    • Somewhat larger projects
      • Sometimes collaborative
  • ADTs, Algorithms, and Data Structures
    • Some of the “Core literature”
    • Practice designing
    • Math-based analysis
  • Less/different underlying support

Course structure

  • Meets two times per week. (New structure.)
  • Many classes will follow the “traditional” pair programming lab structure.
    • Different lab reports: Not “I did this” but “I learned this”.

ADTs and data structures

Don’t forget to ask me when I use a TLA that you don’t understand.

Designing a stack ADT (an exercise)

We will use the Think-Pair-Share (TPS) process. You’ve already thought to yourself (or should have, since it was an assignment). Now it’s time to pair with another person and discuss your answers. Then we will share with each other.

ADT: Use the SAM approach for ADTs.

  • S: Strategy (organizing principle)
  • A: Applications
  • M: Methods

Note: This used to be the PUM approach. I thought SAM was easier to remember.

Strategy

  • Stacks are collections of data in which you can add and remove data. You add and remove data only at the “top” of the stack.
  • Stacks follow a last-in, first-out policy; the thing you remove is the most-recently-added of the things still on the stack.

Applications

  • This
  • That
  • Something else

Methods

We will assume that it’s a stack of strings. We will also assume that we’re implementing it in C.

Please make sure you consider parameters, return types, preconditions, potential questions the client of your stack might have, etc.

_I’ll divide your answers into “core methods” (the ones we probably can’t do without) and “optional methods” (the ones we could implement with the core methods if we wanted to).

Core methods

Almost-core methods

Optional methods

Implementing our stack ADT

We’ll use the AAA approach (which used to be the LIA approach and may get renamed again).

  • Arrangement: How do you lay out the structure in memory?
  • Algorithms: Given that arrangement, how do you implement the methods? (Broadly; we don’t need all the code.)
  • Analysis: Given those implementations, how efficient are the methods?
    • We will usually ask how many steps they do as a function of the number of values we’re working with.
    • We might also ask how much space we use.

Stack arrangements

* * *

Algorithms, Arrangement 1 (???)

Analysis, Arrangement 1 (???)

Algorithms, Arrangement 2 (???)

Analysis, Arrangement 2 (???)

Algorithms, Arrangement 3 (???)

Analysis, Arrangement 3 (???)

Another ADT: Unsized arrays

One of the skills I hope you’ll develop in the course is the ability to design new things (most often, ADTs and data structures). Hence, in addition to labs, we’ll spend a reasonable amount of class time on design problems. You had a lot of time to think about stacks. You’ll have less time for this.

I’ll ask you to take a full minute to think to yourself before you pair and then share.

Unsized arrays: Strategy

I want things that I can use like arrays, but I don’t want to have to specify their capacity in advance. They should always be big enough for how I’m using them.

I’d also prefer not to have a different syntax for arrays than for the structures I build myself.

Unsized arrays: Applications

Unsized arrays: Methods

Core methods

Almost-core methods

Optional methods

Implementing ADTs

If we’re lucky, we’ll have the time to talk through some of these.

Arrangement

Algorithms

Analysis

Probably not this one.