Skip to content

Class 06 (More on Functions)

KJ Monahan edited this page Jun 6, 2024 · 1 revision

Class 6: More on Functions

In the prep work for this lesson, the students learned:

  1. What an anonymous function is and how to write one.
  2. What recursion is and how a function can call itself.
  3. The definitions of "base case" and "recursive case"

Announcements

  1. More info to come... when in doubt, check with the class Candidate Engagement Manager for announcements!

For Part-Time Students:

  1. The second graded assignment is open for you to start working on. Even if you can't solve everything right away, it is important to start working on it since you only have 2 weeks to do it!

For Full-Time Students:

  1. Welcome to Day 8!
  2. Graded Assignment 1 is due at the end of class today

Large Group Time (Instructor)

Lesson 6 Topics That Require Careful Attention

  1. Conversation Starters:
    1. What type of error occurs when attempting to use a value that is NOT a function as if it were one?
    2. Explain the difference between named and anonymous functions, including an example of how an anonymous function can be used.
  2. Reinforce examples of when and why someone may use an anonymous function. Live coding examples are particularly helpful in explaing anonymous functions.
  3. Reinforce examples of when and why someone may choose the recursive solution. While recursion is in the chapter, it should NOT receive a large amount of emphasis. At this point in the students' learning journey recursion pushes against the boundary between an engaging challenge and a discouraging frustration.
  4. Q & A about the chapter exercises.

Studio (IA Notes)

Lesson 6 Studio

  1. Remind learners about how important it is to write a sorting function yourself. The last section of the studio instructions has a lot of really good points about how sorting functions serve as the basis for many technical interview questions.
  2. If learners are stuck, remind them to use pseudo-coding and to think through the steps they need to follow to sort something (i.e. designing their algorithm) before trying to write code.
  3. If learners finish early, encourage them to attempt the bonus mission.