[Index of Lectures]

[ L01 L02 L03 L04 L05 L06 L07 L08 L09 L10 L11 L12 L13 L14 L15 L16 L17 L18 L19 L20 L21 L22 L23 ]

Lecture 04—Interactive programs, big-bang and the HtDW recipe

Before Lecture

At this point you should be comfortable solving problems based on material in all of Module 0, 1a, 1b and 2. Please reach out for help if there is any part of that material you have questions about.

Before lecture you should complete the following 3 subsections of Module 3a: Module Overview, Interactive Programs, and The Big Bang Mechanism.

If you have any concerns about that material work carefully through the relevant videos. You can also pick problems from the Problem Bank tab in the edX course to practice. Or go to TA or instructor office hours.

During Lecture

The HtDD and HtDF recipes give you the foundations for designing programs. But real programs are much more than a single data definition or a single function. Indeed they can comprise thousands of data definitions and tens of thousands of functions—or even much more. Managing such a large project requires working systematically.

The world program recipe (HtDW) helps us manage the design of a particular category of larger program, a simple interactive animation. As you work through these problems you will be working on "copy" of HtDW, one or more copies of HtDD, and a number of copies of HtDF.

By the end of the lecture—including the post-lecture work—you should be able to:

The starter for this lecture is:

After Lecture

First off, big congratulations! Seriously. Most of you did not know how to program at all 3 weeks ago. Now you are learning how to make a simple animated program. It may have gone by too quickly in lecture, but we know that you caught parts of it as it went by. And if you review this material carefully now you will be able to do this. Rest assured that in two weeks you will think this a world program like this is easy. So congratulations for learning so much already!

Here is the solution for this lecture:

We are going to keep working on this program in the next lecture, so please note that this is not a complete solution.

The main point of today's lecture, and one of the main points of the whole course, and in fact design in general is that you can solve big problems by breaking them down into small problems. But to do that:

  1. You have to manage to break it up into smaller problems.
  2. You have to have the discipline to focus on the smaller problems one at a time.
  3. The smaller problems have to be chosen so that their solutions fit back together nicely.

One of the biggest things the design recipes do is A and C above. In the case of a world program design we get lots of small problems, including:

The key to success is the discipline to trust the recipe. At any point in time you need to know exactly where in the recipes you are, and you need to focus on that point. If you allow yourself to get lost and focus on the whole big design problem you will be in trouble. So trust the recipe to help you know what to focus on at any given point in time.

What you should do to review today's material:

If you were comfortable with today's material, then quickly replay the entire design for yourself, by quickly going through the Domain Analysis, Program through main function and Working through the wish list sections. If today's material was challenging for you, then start by carefully working through the domain analysis video, and then redoing the domain analysis for the spider. Then carefully work through the program through main function section, and then do that for the spider.

Next you cal improve the program to have the extra functionality described in the starter. Do this by re-working the entire recipe starting from analysis for each new feature. Do the practice problems as you feel you need to so that you have mastered module 3a. It is critical that you have this material mastered before next lecture.

Finally be sure to complete the Before Lecture section of the next lecture before that lecture.

Be sure to complete the before lecture section of Lecture 5 before that lecture.