teaching machines

CS 145 Lecture 1 – Main

September 7, 2016 by . Filed under cs145, fall 2016, lectures.

Dear students,

Welcome to CS 145: Introduction to Object-oriented Programming. This is the first course in the computer science major, but lots of other folks take it too. In fact, I will show a quick breakdown of all the different majors.

What prompted you to take this class? Very few high schools teach such a course. Maybe you heard that computer scientists get paid well. Maybe your parents put you up to it. Maybe you saw that Googlers get free oil changes and haircuts. Maybe you are a gamer, and this class is your vehicle to that dream job of working at a stress-filled and divorce-provoking business that is the games industry. It’s quite likely that many of you have no idea what we will do in this class. And that’s okay.

Let’s hear how some folks have described the activities of computer science and specifically this class.

In 1961, Perlis presented this analogy:

calculus : rates :: computer science : process

In this class, we will program a pathway between user’s input and desired output. We will break that transformation down into precise steps, kind of like a recipe whose ingredients are numbers and text.

Sometimes people don’t know whether to computer science fits better as an engineering discipline or as a science. Software engineer and computer graphics researcher Brooks has this to say about the matter:

The scientist builds in order to study; the engineer studies in order to build.

In this class we will study and build. You can be either an engineer or a scientist; I don’t care.

Papert, an inventor of the Logo programming language, says this:

Way back in the mid-eighties a first grader gave me a nugget of language that helps. The Gardner Academy (an elementary school in an under-privileged neighborhood of San Jose, California) was one of the first schools to own enough computers for students to spend significant time with them every day. Their introduction, for all grades, was learning to program, in the computer language Logo, at an appropriate level. A teacher heard one child using these words to describe the computer work: “It’s fun. It’s hard. It’s Logo.” I have no doubt that this kid called the work fun because it was hard rather than in spite of being hard.

This class is about hard fun. You will make the computer do things. It will obey your every command. You will discover that you the gap between you and the machine is wide. You will make a lot of mistakes. Thankfully, mistakes are free. The computer doesn’t mind trying again.

I personally summarize this class with one sentence: we will teach machines.

For the rest of our time today, we will introduce ourselves to programming by using Madeup, a Logo-like language for building 3D models. In your first lab, I will ask you to compose a model. We will make a few shapes: a polygon, a spiral, and a heart.

Often when we meet for lecture, I will ask you to do some reading or activities and jot down some observations or reactions on a quarter sheet of paper to be turned in at the beginning of the next class. Since I have a large pile of these to read and sort through, I ask that you form this quarter sheet by dividing a piece of paper in half exactly twice, once vertically and once horizontally.

Consider these quarter sheets as personal and relevant notes to me. Without them, I can only guess what’s going on inside your head.

I will have a box in front of the room for you to turn these “quarter notes” in. That box will be whisked away soon after class starts. To receive participation credit, you must have your note in the box before it disappears. Don’t worry too much if you miss some. There will be occasional extra credit opportunities to regain participation points.

Here’s your TODO list of things to complete before next class:

See you next class!

Sincerely,

P.S.

When we write code together in class, I will share it here. I recommend that you leave your laptops home. I think you’ll get more out of lecture by participating than trying to clone our work up front.

polygon.mup

moveto 0, 0, 0

n = 7
angle = 360.0 / n

repeat n
  move 2
  yaw angle
end

dowel

pasta.mup

moveto 0, 0, 0

nsides = 20
repeat 100
  
  .rgb[0] = 0.01 * random 0, 100
  .rgb[1] = 0.01 * random 0, 100
  .rgb[2] = 0.01 * random 0, 100

  move 0.5
  yaw 10
  roll 2
end

dowel