Return to Video

Lecture 1 Programming Methodology (Stanford)

  • 0:12 - 0:15
    This presentation is delivered by the Stanford Center for Professional
  • 0:15 - 0:22
    Development.
  • 0:23 - 0:25
    So welcome to CS106A.
  • 0:25 - 0:28
    If you don't think you should be in CS106A, you think you should be somewhere
  • 0:28 - 0:31
    different, now is probably a good time
  • 0:31 - 0:34
    to go, not that I would discourage anyone from taking this class. I think we'll have a lovely
  • 0:34 - 0:35
    time in here.
  • 0:35 - 0:40
    But this class is CS106A or E70A, so if you're,
  • 0:40 - 0:43
    like, "Wait. I thought I was in E70A," you're fine. They're the same class; it's the
  • 0:43 - 0:45
    same thing. No worries,
  • 0:45 - 0:49
    okay? There's four handouts. They're in the back. If you haven't already gotten the handouts because you came in and
  • 0:49 - 0:52
    you sat down, don't worry. You can pick them up on the way out. They're
  • 0:52 - 0:54
    the same handouts. They'll still be there.
  • 0:54 - 0:56
    So
  • 0:56 - 1:00
    just a quick introduction. That's what the first four handouts actually give you.
  • 1:00 - 1:03
    They give you a little bit of an introduction to the class, what we're gonna cover, some
  • 1:03 - 1:06
    logistics for the class and some other stuff. I'm gonna go over all
  • 1:06 - 1:10
    that today so we can sort of get a good idea for where we're at, okay? So just a quick show
  • 1:10 - 1:14
    of hands before we get into a bunch of things in the class.
  • 1:14 - 1:18
    This is kind of an intro-programming course; well, it is. I shouldn't say it's kind of an
  • 1:18 - 1:20
    intro-programming course. It is an intro-programming course. And
  • 1:20 - 1:24
    it's always good to get an idea as to how much familiarity you may have
  • 1:24 - 1:25
    beforehand, okay?
  • 1:25 - 1:27
    So just quick show of hands.
  • 1:27 - 1:31
    How many people can recognize a computer that's on?
  • 1:31 - 1:36
    Good, good. That's the prerequisite for this class. So if you're worried about
  • 1:36 - 1:38
    how much previous experience you've had
  • 1:38 - 1:42
    or your friend who, like, worked their way through high school by programming for Google or
  • 1:42 - 1:43
    whatever,
  • 1:43 - 1:46
    don't worry about it because all you need to know in here is basically
  • 1:46 - 1:50
    either how to turn a computer on or to recognize a computer that's on if you
  • 1:50 - 1:53
    were to walk up to it and it were already to be on, all right?
  • 1:53 - 1:57
    So but a little bit more seriously, how many people have actually used a computer
  • 1:57 - 1:59
    for anything?
  • 1:59 - 2:02
    All right. I would expect most of you. So now, we begin to bump it up
  • 2:02 - 2:05
    a notch. How many people have used it for word processing?
  • 2:05 - 2:10
    Okay. Most folks. How many people have done web browsing?
  • 2:10 - 2:13
    Yeah, I won't ask you what you look at, all right? It's just I don't wanna know.
  • 2:13 - 2:17
    How many people have actually created a web page? Okay.
  • 2:17 - 2:23
    Fair number. How many people have done any kind of programming before?
  • 2:23 - 2:24
    Fair number.
  • 2:24 - 2:29
    All right. How about how many folks have done actually programmed in Java before?
  • 2:29 - 2:34
    All right. A few folks. How about another language, C, C++,
  • 2:34 - 2:35
    BASIC,
  • 2:35 - 2:38
    anyone program in BASIC? Yeah,
  • 2:38 - 2:41
    oh, I love - that was the first language I learned, and it was kind of
  • 2:41 - 2:45
    like the warm and fuzzy, and I felt good. There was actually people who argued that if you learn
  • 2:45 - 2:48
    BASIC as your first language, you're brain damaged, then you're just beyond help. But if
  • 2:48 - 2:49
    that's the case, we're all
  • 2:49 - 2:52
    in the boat together because I'm probably brain damaged as well. The truth is I
  • 2:52 - 2:55
    probably am, but that's a whole different story.
  • 2:55 - 2:58
    All right. So one thing you should know kind of up front is actually this course
  • 2:58 - 3:01
    is gonna be provided eventually somewhere down the line as part of
  • 3:01 - 3:04
    Stanford School of Engineering Free Course Initiative,
  • 3:04 - 3:07
    which means not only are we recording this course to broadcast to a bunch
  • 3:07 - 3:10
    of companies and industry who are watching this course, but we're eventually
  • 3:10 - 3:12
    gonna provide it free to the world.
  • 3:12 - 3:14
    So how does that impact your life?
  • 3:14 - 3:17
    And on the average day, it doesn't at all.
  • 3:17 - 3:20
    The only way it does impact your life is just so you should know, the lawyers told me to
  • 3:20 - 3:21
    tell you that your
  • 3:21 - 3:24
    voice, should you ask a question, may actually be recorded as part of the
  • 3:24 - 3:25
    video.
  • 3:25 - 3:29
    As a result, your voice may end up going out to thousands of people or millions
  • 3:29 - 3:31
    of people in the world.
  • 3:31 - 3:33
    If you have an issue with that, come talk to me.
  • 3:33 - 3:37
    If you don't, everything is just fine, all right? Don't worry. We're not gonna put your picture up
  • 3:37 - 3:40
    or anything like that. You might wanna be on the video, like, "Hey,
  • 3:40 - 3:41
    ma, I'm on
  • 3:41 - 3:44
    TV." We decided that we're just gonna not show anyone actually on the video,
  • 3:44 - 3:46
    but your voice may actually get recorded, okay?
  • 3:46 - 3:50
    Now, along those lines, you may also notice there are some microphones in the room.
  • 3:50 - 3:53
    So when you wanna ask a question, please make sure to use the microphone
  • 3:53 - 3:56
    because that's not only good for people in here to be able to hear your question,
  • 3:56 - 4:00
    it's also good for all the folks that this is getting broadcast to because not
  • 4:00 - 4:02
    only are we gonna broadcast to the world, but there's actually some folks who are sort
  • 4:02 - 4:06
    of watching this live now in various companies in Silicon Valley.
  • 4:06 - 4:08
    So it's real important that you actually use the microphone, so just remember that. And
  • 4:08 - 4:11
    every once in a while, I might get on your case and be, like, "Please use the microphone."
  • 4:11 - 4:15
    I'm not trying to be argumentative or anything. I just wanna make sure we
  • 4:15 - 4:16
    pick up all the audio, all
  • 4:16 - 4:20
    right? So with that said, a little bit of an introduction. That's kind of a way of background.
  • 4:20 - 4:23
    I didn't give you any sort of introduction. So just to introduce myself, my name's
  • 4:23 - 4:25
    Mehran Sahami. I'm the professor for the class.
  • 4:25 - 4:28
    Don't call my Professor Sahami, way too formal.
  • 4:28 - 4:32
    Don't call me Mr. Sahami. That, I think of my dad.
  • 4:32 - 4:35
    And don't call me Mrs. Sahami, or we're gonna have issues, all right?
  • 4:35 - 4:36
    So just call me
  • 4:36 - 4:41
    Mehran. We'll get along. It's just fine, all right? It's to keep things a little bit more
  • 4:41 - 4:43
    informal, but that way it's a little bit easier to discuss stuff as you go along.
  • 4:43 - 4:47
    There is also a head TA for the class, Ben Newman, who's standing up there. Get to know
  • 4:47 - 4:48
    Ben.
  • 4:48 - 4:52
    He has all the real power in this class. I'm just kind of the monkey that gets up here and
  • 4:52 - 4:54
    gives the lectures. But Ben really is the one who's got all the
  • 4:54 - 4:55
    power.
  • 4:55 - 4:58
    Along with the head TA for the class, we have a large section leading staff. So
  • 4:58 - 5:04
    the section leaders here, could you stand up if you're here? They're kind
  • 5:04 - 5:06
    of all over the place, some over here, some over there, and some over there. As
  • 5:06 - 5:10
    you can see, there's a pretty large number of folks. And this isn't even all of them.
  • 5:10 - 5:13
    We sort of have more - we just can't stuff them all into the room -
  • 5:13 - 5:17
    who are section leaders for the class, and these folks are all here to make sure
  • 5:17 - 5:20
    that everyone in this class has as good an experience as possible when
  • 5:20 - 5:23
    we're sort of going through the class. And the best way to reach all of us is
  • 5:23 - 5:26
    email. So on Handout No. 1, you get my email and Ben's email.
  • 5:26 - 5:30
    We'll tell you how to sign up for section. That's how you'll meet your section leader and get your section
  • 5:30 - 5:34
    leader's email. That will all be coming soon. But email really is kind of a happy form of
  • 5:34 - 5:35
    communication to
  • 5:35 - 5:37
    get a hold of us, okay?
  • 5:37 - 5:40
    So with that said, I wanna tell you a little bit about this class and kind of
  • 5:40 - 5:43
    what we're gonna do in here and what you should expect and make sure that
  • 5:43 - 5:44
  • 5:44 - 5:48
    you don't feel scared off by this class, okay? Because it really is meant to sort of be an
  • 5:48 - 5:49
    interesting time.
  • 5:49 - 5:53
    But one question that comes up is why is this class called Programming
  • 5:53 - 5:53
    Methodology,
  • 5:53 - 5:56
    right? Why don't we just call this class, like,
  • 5:56 - 5:58
    Programming with Java?
  • 5:58 - 6:01
    And the real reason for that is that programming methodology is about good
  • 6:01 - 6:04
    software engineering principles. It's about something that's much larger than
  • 6:04 - 6:07
    just programming. So some people, like, they'll go and get a book somewhere and they'll
  • 6:07 - 6:10
    think they learned how to program by just reading the book. And they're,
  • 6:10 - 6:13
    like, "Oh, I know how to program. Isn't that great?" And it's, like,
  • 6:13 - 6:16
    yeah, you might know the mechanics of the language, but the mechanics of the
  • 6:16 - 6:19
    language are nothing compared to understanding the software engineering
  • 6:19 - 6:20
    principles
  • 6:20 - 6:23
    that go into actually developing a software system. And that's what you're gonna
  • 6:23 - 6:26
    learn about in this class. You're gonna learn a lot of those principles. But in order
  • 6:26 - 6:27
    to be able to use
  • 6:27 - 6:31
    those principles and apply them, you also need to have the language to program in,
  • 6:31 - 6:34
    and that language that we're gonna use in this class is Java. So the way I like to
  • 6:34 - 6:37
    think about it and the way I tell a lot of people is writing a good program or
  • 6:37 - 6:40
    learning how to program is like learning to be a good
  • 6:40 - 6:42
    essay writer. And you're, like, "Oh, but part
  • 6:42 - 6:46
    of the reason I'm taking this class, Mehran, is that I don't like writing essays." That's fine.
  • 6:46 - 6:49
    It's okay. Trust me. I didn't like writing essays either. But
  • 6:49 - 6:52
    the whole point is that when you write an essay, it's not a formulated kind of
  • 6:52 - 6:56
    thing. You're, like, "Well, what about five-paragraph essays?" Yeah, just block that from
  • 6:56 - 7:00
    your mind. That was a bad time, right? That was just, like, '70s education at work.
  • 7:00 - 7:03
    It's not a formulated kind of thing. There's an art to writing an essay,
  • 7:03 - 7:06
    right? In order to write an essay, you need to know a language. You need to know English or German or
  • 7:06 - 7:08
    Hindi or whatever language you wanna use,
  • 7:08 - 7:11
    but then you use that language to write an essay.
  • 7:11 - 7:14
    Just knowing the language doesn't make you a good essay writer though. Being
  • 7:14 - 7:16
    a good essay writer makes you a good essay writer.
  • 7:16 - 7:20
    So that's the same difference in programming and software engineering. Knowing the
  • 7:20 - 7:23
    language, in order to be a good programmer, like a good essayist,
  • 7:23 - 7:27
    you need to know a language to write your programs in, whether that be Java or C or
  • 7:27 - 7:30
    C++ or whatever. Here we're gonna use Java.
  • 7:30 - 7:33
    But just knowing the language doesn't make you a good software engineer and
  • 7:33 - 7:36
    doesn't make you understand what the principles are of writing good software,
  • 7:36 - 7:40
    which is what you're also gonna get in this class in addition to the language, and that's kind of
  • 7:40 - 7:42
    a key thing to stress.
  • 7:42 - 7:45
    So if you're sort of worried, if you were kind of looking around and you saw a bunch of people raising
  • 7:45 - 7:46
    their hands when I asked, "Do
  • 7:46 - 7:49
    you have any previous programming experience?" and some folks raised their
  • 7:49 - 7:53
    hands, and you got a little worried and you're like, "Oh, am I gonna be in some sense at
  • 7:53 - 7:57
    a disadvantage because I haven't done any programming before?" The answer, plain and
  • 7:57 - 7:58
    simple, is no, okay? You're
  • 7:58 - 8:01
    gonna learn everything you need to learn from the first principle because as a
  • 8:01 - 8:02
    matter of fact,
  • 8:02 - 8:06
    in some cases you might be in slightly better shape. That's not necessarily to say
  • 8:06 - 8:08
    that that's the way it will be. But
  • 8:08 - 8:11
    how many people are Star Wars fans? Just wondering. Anyone? I'm
  • 8:11 - 8:14
    talking about the old-school, original, like, three movies. Those were so good, and
  • 8:14 - 8:18
    we're not - no George R. Binks here, all right?
  • 8:18 - 8:22
    So if you remember - and sort of I'm a big Star Wars fan, and that's just a whole
  • 8:22 - 8:23
    separate point.
  • 8:23 - 8:26
    But in the second movie, Yoda actually said something which I thought was quite
  • 8:26 - 8:28
    profound, which is he says
  • 8:28 - 8:31
    sometimes you have to unlearn what you have learned.
  • 8:31 - 8:34
    And one of the things we actually find is that some people who are self-taught programmers,
  • 8:34 - 8:37
    some of them are just fine, and some of them are very good.
  • 8:37 - 8:40
    But some of them have picked up some really bad habits along the way, and it's
  • 8:40 - 8:41
    like being a bad essay writer.
  • 8:41 - 8:45
    And to go from being a bad essay writer to a good essay writer, in some cases, can
  • 8:45 - 8:46
    actually be harder
  • 8:46 - 8:49
    than from not being an essay writer to being a good essay writer because you
  • 8:49 - 8:51
    have to unlearn the bad habits.
  • 8:51 - 8:54
    So if you're worried about, "Oh, I've had no previous experience,"
  • 8:54 - 8:57
    don't worry. You're okay, blank slate, you're just fine. And now if you're thinking,
  • 8:57 - 9:01
    "Oh, I have some previous experience. Do I have bad habits?" Don't worry. You'll be
  • 9:01 - 9:05
    fine, too, okay? So it's all gonna work out.
  • 9:05 - 9:08
    So the next question that kind of comes up - hopefully that helps put some of your fears
  • 9:08 - 9:08
    aside.
  • 9:08 - 9:12
    Another one of the things is that we really strive to make everyone successful in this
  • 9:12 - 9:14
    class, okay? At some other schools,
  • 9:14 - 9:17
    people wanna do computer science or they wanna do an
  • 9:17 - 9:19
    engineering major or whatever. And you come into the first day of class, and they say,
  • 9:19 - 9:23
    "Oh, only one third of you are actually gonna make it through this program. And
  • 9:23 - 9:26
    look to the person to your left and look to the person to your right, and only one
  • 9:26 - 9:28
    of you will make it through." And you're, like, "Oh,
  • 9:28 - 9:30
    man, that's real nice."
  • 9:30 - 9:33
    It's not like that here. As a matter of fact, we want all of you to be extremely
  • 9:33 - 9:37
    successful in this class, which is why we have a huge course staff, which is why over years
  • 9:37 - 9:40
    and years we've refined how we do a lot of the teaching in this class
  • 9:40 - 9:44
    to make sure you have the best possible experience and to make sure that everyone
  • 9:44 - 9:45
    gets through.
  • 9:45 - 9:49
    And the important thing about that is that you're not competing against anyone
  • 9:49 - 9:51
    except yourself in this class. It's not like we're gonna have a curve and
  • 9:51 - 9:54
    we're gonna say, "Oh, we have a certain number of "F"s and a certain number of
  • 9:54 - 9:56
    "D"s and a certain number of "C"s."
  • 9:56 - 9:59
    All we really have going into it is an expectation that when you get out of
  • 9:59 - 10:02
    here, there's a set of stuff we want you to know.
  • 10:02 - 10:03
    And if you know that stuff well,
  • 10:03 - 10:04
    you get an "A."
  • 10:04 - 10:07
    And if everyone knows that stuff well,
  • 10:07 - 10:08
    everyone gets an "A."
  • 10:08 - 10:11
    And I got no problems with that. Registrar might have a problem with that, but that's okay.
  • 10:11 - 10:13
    You don't need to worry about that.
  • 10:13 - 10:15
    So you don't need to think about, oh,
  • 10:15 - 10:18
    is someone else doing better than you or whatever. And we'll talk about
  • 10:18 - 10:21
    issues of collaboration in just a little bit. All you need to think about is
  • 10:21 - 10:25
    learning the stuff yourself as well as you possibly can, and you'll be just fine
  • 10:25 - 10:27
    and you'll get a good grade, okay?
  • 10:27 - 10:29
    So that's really all we ask,
  • 10:29 - 10:30
    which is not
  • 10:30 - 10:33
    a trivial amount, right? It requires you to really understand the material.
  • 10:33 - 10:36
    So another question that comes up is are you in the right place, right? This
  • 10:36 - 10:39
    isn't the only introductory programming class at Stanford. And so I wanna spend a
  • 10:39 - 10:42
    little bit of time making sure you actually are in the right place
  • 10:42 - 10:45
    by going over some of the different options. So right
  • 10:45 - 10:47
    now, as you know, you're in CS106A.
  • 10:47 - 10:50
    And CS106A, we're sort of happy over here,
  • 10:50 - 10:51
    right? As
  • 10:51 - 10:55
    a matter of fact, we're not only happy, we're happy and we're also a little bit loopy,
  • 10:55 - 10:57
    right?
  • 10:57 - 11:00
    There is no previous programming experience required, as I mentioned, right? All you
  • 11:00 - 11:04
    need to know is basically if you can get to a computer and know how to
  • 11:04 - 11:07
    figure out that it's on, you're in good shape.
  • 11:07 - 11:11
    But what 106A does is it's a real rigorous class. You learn programming in
  • 11:11 - 11:14
    here, and you learn it in a way that makes you ready to be an engineer if you so
  • 11:14 - 11:16
    choose to be an engineer.
  • 11:16 - 11:18
    That's not to say you're all gonna be engineers. I would love for all of you to
  • 11:18 - 11:21
    be computer science majors, but statistics in the past show only about
  • 11:21 - 11:24
    6 percent of you will be computer science majors. That's not because we
  • 11:24 - 11:26
    turn anyone off to computer science;
  • 11:26 - 11:29
    it's because we make programming accessible to so many people
  • 11:29 - 11:32
    that you don't have to be a computer science or a Double E or even an
  • 11:32 - 11:35
    engineering major to do extremely well in the class. And we actually have sort
  • 11:35 - 11:39
    of a significant percentage of the entire campus undergraduate student body
  • 11:39 - 11:42
    at Stanford actually goes through this class and does well, okay?
  • 11:42 - 11:46
    So don't worry if you're, like, "Oh, but I'm not really a CS person." I hope
  • 11:46 - 11:49
    we'll turn you into one by the end of the class. No, it's okay. But
  • 11:49 - 11:53
    you'll be prepared if that's what you wanna do. So this leads into a whole
  • 11:53 - 11:54
    engineering sequence
  • 11:54 - 11:59
    that can go on to other engineering majors or the computer science majors.
  • 11:59 - 12:02
    If you're, like, "Huh, I'm not sure if that's really what I wanna do. As a matter of fact,
  • 12:02 - 12:05
    I'm so sure that's not what I wanna do,
  • 12:05 - 12:07
    I only wanna get the general educational requirement out of the way, and
  • 12:07 - 12:11
    I'm positive there is nothing else I wanna do. Really, no matter how much I like
  • 12:11 - 12:15
    it, like, there is no way you're gonna drag me into anything that would involve
  • 12:15 - 12:17
    anything remotely techie."
  • 12:17 - 12:22
    They're the class CS105. And this is happy,
  • 12:22 - 12:22
    yeah,
  • 12:22 - 12:26
    this is kind of, oh, we're happy in our little happy world.
  • 12:26 - 12:30
    And I don't wanna say it's holding hands and singing, "Kumbaya," because that's not what it is. It's a real
  • 12:30 - 12:34
    class.
  • 12:34 - 12:38
    But it's meant to be a general educational requirement, right? It
  • 12:38 - 12:42
    doesn't lead into the 106s. It's meant to be its own self-contained class.
  • 12:42 - 12:45
    You do some Java script in there. You do a little bit of what computers are about.
  • 12:45 - 12:49
    Computers in society is a good time. We all hold hands. We're all happy. I don't
  • 12:49 - 12:51
    teach the class, so I don't actually hold hands.
  • 12:51 - 12:54
    But it's a fun time, okay? It just doesn't lead to anything else. So think of this as
  • 12:54 - 12:58
    kind of a terminal class, right? So it's sort of like, well, we'll hook you up to the
  • 12:58 - 13:00
    IV drip. And
  • 13:00 - 13:02
    you're, like, "Well, 106A, you told me I don't need any previous background.
  • 13:02 - 13:03
    Well,
  • 13:03 - 13:08
    hey, Mehran, I got lots of background. I got so much background, it hurts. I got AP
  • 13:08 - 13:10
    background, I got working through school doing software engineering
  • 13:10 - 13:11
    background.
  • 13:11 - 13:13
    I'm not sure I should be here."
  • 13:13 - 13:17
    That could be the case. We have another class called CS106X, and as
  • 13:17 - 13:22
    the "X" kind of implies, it's sort of the extreme games version of the class. No, it
  • 13:22 - 13:24
    stands for accelerated, right, because
  • 13:24 - 13:29
    "A" was already taken, so we had to come up with something else.
  • 13:29 - 13:33
    So the way CS106X works is it really is a very fast-paced class. It's
  • 13:33 - 13:36
    meant for people who've got previous AP exam
  • 13:36 - 13:38
    credit, like, got a 4 or 5 on the AP,
  • 13:38 - 13:41
    or have had significant and prior programming experience before.
  • 13:41 - 13:44
    If you're not sure which one of these classes is for you, you can come talk to me
  • 13:44 - 13:48
    afterwards, or I'd also encourage you, you could go to pick up the syllabus for
  • 13:48 - 13:50
    CS106X and compare it to CS106A.
  • 13:50 - 13:55
    This class is all in C++. And if you're thinking, "Hey, Mehran, I'm doing 106A. I wanna learn
  • 13:55 - 13:59
    Java and C++," don't worry. You'll eventually, if you so choose, take a
  • 13:59 - 14:03
    class called CS106B, which is where this class sort of leads to, which
  • 14:03 - 14:04
    is
  • 14:04 - 14:07
    C++ and all of the other stuff you would have learned in this accelerated
  • 14:07 - 14:08
    class,
  • 14:08 - 14:11
    okay? So you still certainly have that course path. So don't let anyone make you think -
  • 14:11 - 14:15
    I know a lot of times, and especially for Stanford students, you come in here and you're, like, "Well,
  • 14:15 - 14:18
    every class I took in high school was like an honors or an AP class,
  • 14:18 - 14:21
    or if it wasn't an honors or an AP class, like, I had to tie half my brain
  • 14:21 - 14:23
    before my head because I'm just that hardcore."
  • 14:23 - 14:26
    And so everyone just wants to, like, do
  • 14:26 - 14:30
    the most hardcore thing they can, right? And what I'm here to tell you is that
  • 14:30 - 14:32
    you shouldn't necessarily think about it that way. You should think about it as where
  • 14:32 - 14:35
    you feel most comfortable.
  • 14:35 - 14:38
    Some number of years ago, let's just say greater than 10, maybe 15, I was
  • 14:38 - 14:41
    sitting where you're sitting right now,
  • 14:41 - 14:41
    literally.
  • 14:41 - 14:45
    I was in CS106A in Terman Auditorium as a freshman,
  • 14:45 - 14:49
    okay? It was perfectly fine. It worked out. I went to grad school, did the faculty
  • 14:49 - 14:54
    thing. It's just fine. It will open your doors to CS. You're not at any kind of
  • 14:54 - 14:57
    disadvantage by starting here. So know where you've been, literally. Like, that seat
  • 14:57 - 14:58
    right there was where I was
  • 14:58 - 15:00
    most of the time.
  • 15:00 - 15:03
    So just something to keep in mind in terms of the different options that are actually
  • 15:03 - 15:04
    available to you.
  • 15:04 - 15:08
    Now, with that said, let's just assume for the rest of this lecture that this is the
  • 15:08 - 15:11
    right place for you. And if it's not, well, afterwards we can kind of talk about it,
  • 15:11 - 15:14
    or if you really are convinced now that it's not the right place, you can feel free and try
  • 15:14 - 15:15
    to
  • 15:15 - 15:18
    scramble over 20 of your classmates and actually leave the room, which is
  • 15:18 - 15:20
    probably impossible. All right.
  • 15:20 - 15:23
    So a few other things you should know, some mechanics. So Handout No. 1, should
  • 15:23 - 15:25
    you wanna follow along at home,
  • 15:25 - 15:27
    is the class web page.
  • 15:27 - 15:32
    And so all the stuff that we think of as course materials, including online
  • 15:32 - 15:35
    copies of the handouts, things that you'll need to do for the assignments, announcements
  • 15:35 - 15:36
    related to the class
  • 15:36 - 15:38
    are all on the class web page,
  • 15:38 - 15:45
    which is
  • 15:47 - 15:49
    www.stanford.edu/class/cs106a.
  • 15:49 - 15:52
    And because that's just kind of a whole bunch to remember, we make your life easy
  • 15:52 - 15:57
    and so there is an equivalent form of the URL, which is just
  • 15:57 - 16:01
    cs106a.stanford.edu, which is the easy thing to remember. You put that in, it'll take
  • 16:01 - 16:03
    you to the class web page, okay?
  • 16:03 - 16:06
    And you should check that regularly because all the
  • 16:06 - 16:09
    announcements and handouts - we'll give out hard copies of all the handouts in class, but
  • 16:09 - 16:12
    should you happen to miss class for whatever reason, you wanna go print
  • 16:12 - 16:15
    whatever copies of the handouts we're actually giving out, you can find them all on
  • 16:15 - 16:16
    the web page, okay?
  • 16:16 - 16:20
    Now, there's this funky thing about units. So you may have noticed that this class is for three
  • 16:20 - 16:24
    to five units, and that kind of brings up the natural question, "Should I take it for three
  • 16:24 - 16:25
    or five units?"
  • 16:25 - 16:29
    If you're an undergrad, you take it for five units, end of story. That's life in the city.
  • 16:29 - 16:31
    Congratulations. Five units.
  • 16:31 - 16:34
    If you're a graduate student, you can have the option of taking it for three
  • 16:34 - 16:38
    units if you want, if you're gonna run into some unit cap.
  • 16:38 - 16:41
    It doesn't change the amount of work you have to do.
  • 16:41 - 16:43
    Welcome to graduate school.
  • 16:43 - 16:45
    Same work, fewer units.
  • 16:45 - 16:48
    So that's just the way life is. If you have a unit cap and you're a grad student, in
  • 16:48 - 16:51
    three units you can take it if you want. You can take it for five if you want as well. If you're an
  • 16:51 - 16:53
    undergrad, you take it for five, all right?
  • 16:53 - 16:56
    So why is it five units? And you might think, "Hey,
  • 16:56 - 16:59
    this class only meets three times a week. How come it's five units?" Well, it actually
  • 16:59 - 17:03
    has a fourth meeting every week, which is your section, and that's something you
  • 17:03 - 17:04
    should sign up for.
  • 17:04 - 17:07
    So how you actually sign up for your section
  • 17:07 - 17:11
    is sections are at a bunch of different times. You don't sign up for them in
  • 17:11 - 17:13
    Axess, even though they're all kind of listed in the time schedule. That's not where
  • 17:13 - 17:16
    you sign up for them. In Axess, you just sign up for the class.
  • 17:16 - 17:21
    How you sign up for a section is you go to a website, cs198.stanford.edu/section
  • 17:21 - 17:22
  • 17:22 - 17:25
  • 17:25 - 17:31
    and this will give us a list of preferences for
  • 17:31 - 17:34
    section times that you wanna sign up for, and there's some matching process that goes on.
  • 17:34 - 17:37
    It takes all your preferences into consideration with the whole system, and
  • 17:37 - 17:39
    eventually you get an email
  • 17:39 - 17:42
    by sometime early next week that tells you what section you're in. And section's 50
  • 17:42 - 17:46
    minutes, once a week. It's required to go to. It's actually gonna be part of your class
  • 17:46 - 17:49
    participation grade, which we'll talk about in just a bit, okay?
  • 17:49 - 17:53
    When do these sign-ups happen? They happen between 5:00 p.m. this Thursday
  • 17:53 - 17:56
    is when they go up. So if you try to go there now, you can't sign up. Remember 5:00
  • 17:56 - 17:59
    p.m. Thursday. So they're up, and then they're down
  • 17:59 - 18:04
    at 5:00 p.m. on Sunday, okay? So
  • 18:04 - 18:07
    make sure you sign up probably this weekend. If you're planning on being out of
  • 18:07 - 18:10
    town this weekend, you wanna sign up before you go. Sign up early, but don't
  • 18:10 - 18:14
    sign up often because you only need one section, okay?
  • 18:14 - 18:17
    If you're an SCPD student - every once in a while you'll hear me refer to SCPD
  • 18:17 - 18:20
    students. That stands for Stanford Center for Professional Development.
  • 18:20 - 18:23
    They are the folks in industry who actually take this class
  • 18:23 - 18:26
    via broadcast. If you're an SCPD student, you're automatically enrolled for a section,
  • 18:26 - 18:30
    so you don't actually need to do this, and your section will meet at - so for SCPD
  • 18:30 - 18:34
    - and if you're wondering what an SCPD student is, you're not one, okay?
  • 18:34 - 18:40
    So SCPD section meets Friday from 1:15 to 2:05. It meets
  • 18:40 - 18:44
    live, if you wanna go there live, in Skilling Auditorium. But if you're
  • 18:44 - 18:48
    watching it remotely, it meets on Channel E2. I
  • 18:48 - 18:53
    know it seems weird to say it meets on channel - what does that mean? It meets on
  • 18:53 - 18:57
    Channel E2, okay? That is grammatically the correct way of saying it.
  • 18:57 - 18:58
    All right.
  • 18:58 - 19:02
    So there's a little bit more administrative stuff. Now,
  • 19:02 - 19:05
    textbooks, right? Textbooks, there's nothing quite like the extortion that is
  • 19:05 - 19:07
    textbooks. So there are
  • 19:07 - 19:10
    two textbooks that are required for this class. Well, one's a course reader and
  • 19:10 - 19:13
    one's a textbook. The course reader is called, Karel the Robot Learns Java. You
  • 19:13 - 19:16
    can pick it up at the bookstore. It's relatively cheap. It was actually written by Eric
  • 19:16 - 19:20
    Roberts here. And surprisingly enough, the textbook for the class was also written by
  • 19:20 - 19:23
    Eric Roberts, The Art and Science of Java, which is available now in your local
  • 19:23 - 19:25
    bookstore,
  • 19:25 - 19:28
    including the bookstore on campus, so you can go and pick up a copy of this.
  • 19:28 - 19:31
    So both these things you actually wanna have because they're required for the
  • 19:31 - 19:34
    class. We'll go through all of them. We'll go through basically everything except
  • 19:34 - 19:36
    the last chapter of this book. So you
  • 19:36 - 19:38
    sort of get your money's worth. We're just gonna do it a little bit out of
  • 19:38 - 19:41
    order, but we'll go through the whole thing,
  • 19:41 - 19:43
    okay? So email,
  • 19:43 - 19:46
    how many of you have email accounts? All
  • 19:46 - 19:49
    right. I will ask the reverse question because I think at this point, some people just don't
  • 19:49 - 19:50
    wanna put up their hands.
  • 19:50 - 19:53
    How many people don't have email accounts?
  • 19:53 - 19:56
    Odd how that is not the complement of the folks who had their hands up
  • 19:56 - 19:57
    previously.
  • 19:57 - 20:01
    Email's required for this class. Chances are, by being at Stanford, you've already gotten an
  • 20:01 - 20:04
    email account through your SUNet ID, but if you don't have an email account, get
  • 20:04 - 20:06
    an email account and that's how you'll stay in contact with us. That's how we'll stay in
  • 20:06 - 20:09
    contact with you, except we'll also meet with you live in person,
  • 20:09 - 20:12
    but email is kind of the general method for communication. As a matter of fact, for your
  • 20:12 - 20:15
    first assignment, and part of your first assignment is to send us an email,
  • 20:15 - 20:17
    just because we love you
  • 20:17 - 20:19
    and we don't get enough email as it is.
  • 20:19 - 20:21
    So you need to have an email account to be able to do that. So if you have not
  • 20:21 - 20:24
    already, you can kind of get ahead of the game and go set up your email
  • 20:24 - 20:27
    account. Now, don't worry. You'll get the first assignment next time. So you still get, like,
  • 20:27 - 20:30
    two days of breathing space before your assignment goes out, okay?
  • 20:30 - 20:33
    There is also gonna be lots of handouts in the class. They'll be either given out in class,
  • 20:33 - 20:37
    well, they will be given out in class, but we'll also post them online in case you miss them.
  • 20:37 - 20:41
    And how much real work do you do in this class? That's always kind of an interesting
  • 20:41 - 20:41
    question.
  • 20:41 - 20:43
    So let's talk a little bit about assignments
  • 20:43 - 20:47
    and a little bit of other logistical things.
  • 20:47 - 20:50
    So assignments,
  • 20:50 - 20:54
    we'll just call them the dreaded assigns. There are seven programming assignments.
  • 20:54 - 20:57
    And if you look at the syllabus Handout No. 2, it tells you when all of them
  • 20:57 - 21:01
    are due all the way through by day, so you can plan out your whole quarter. It's
  • 21:01 - 21:04
    just that much fun, okay?
  • 21:04 - 21:07
    And these seven programming assignments are weighted slightly more toward the
  • 21:07 - 21:10
    last assignments because the assignments will tend to get more complicated. That doesn't
  • 21:10 - 21:12
    necessarily mean there'll be more programming;
  • 21:12 - 21:15
    it just means conceptually, they'll become more complicated,
  • 21:15 - 21:18
    so we tend to weigh them more toward the end of the class. So the later assignments count
  • 21:18 - 21:20
    more than the early assignments.
  • 21:20 - 21:25
    How you're gonna be actually doing your programming is using a little tool called Eclipse.
  • 21:25 - 21:28
    And Eclipse thankfully is free, so you don't have to pay for it. As a matter of
  • 21:28 - 21:31
    fact, you can download it from the CS106A website. And if you're wondering
  • 21:31 - 21:35
    how you do that, don't worry. We'll give you a handout next class that explains
  • 21:35 - 21:37
    to you the whole grueling process
  • 21:37 - 21:39
    of downloading and installing Eclipse.
  • 21:39 - 21:43
    And you can use this either on the Mac or the PC. So if you have your own
  • 21:43 - 21:46
    computer, you can certainly work on this yourself. You just download it to your
  • 21:46 - 21:49
    own machine. We'll explain the whole process in a handout.
  • 21:49 - 21:53
    If you don't have your own computer, the public computer clusters on campus
  • 21:53 - 21:56
    will have Eclipse installed on them, and so you can use Eclipse there. So you're
  • 21:56 - 21:59
    sort of happy to go either way, okay? Now,
  • 21:59 - 22:01
    the important thing, remember I mentioned that whole notion of software
  • 22:01 - 22:04
    engineering in the class, and that's something we take really seriously, so
  • 22:04 - 22:06
    seriously as a matter of fact that when you turn in your assignments, one thing we could do is we could take
  • 22:06 - 22:07
    your assignments
  • 22:07 - 22:11
    and we could just kind of look at it and go, "Yeah, interesting, 'B.' Here you go.
  • 22:11 - 22:13
    Thanks for playing."
  • 22:13 - 22:17
    And you don't learn a whole lot from them. So in order to actually learn a lot from
  • 22:17 - 22:19
    your assignments, we could take your assignment and write a whole bunch of
  • 22:19 - 22:23
    comments on it and hand it back to you. Even that's kind of not enough.
  • 22:23 - 22:27
    What really is a little bit more that makes it more fun is every week after
  • 22:27 - 22:30
    you turn in your assignment and your section leader looks it over and grades it,
  • 22:30 - 22:33
    you'll actually meet with your section leader for about 10 to 15 minutes
  • 22:33 - 22:35
    every week or every time an assignment is due
  • 22:35 - 22:38
    to actually go over in something referred to as interactive grading. And it's
  • 22:38 - 22:41
    a chance to sit there and talk with an actual human being about what's good in
  • 22:41 - 22:45
    your assignment, what are some of the things you need to work on, what are some of the
  • 22:45 - 22:48
    software engineering principles you need to develop. And that way, you can really
  • 22:48 - 22:52
    sort of get more detailed information and be able to ask questions to develop
  • 22:52 - 22:56
    yourself as a programmer as well as get help if you need help,
  • 22:56 - 23:00
    okay? And that's in addition to going to section, going to class and all that stuff. So
  • 23:00 - 23:03
    it's another 15 minutes a week. You'll actually schedule that time with your
  • 23:03 - 23:05
    section leader on a regular basis
  • 23:05 - 23:08
    when you're gonna have interactive grading or just affectionately
  • 23:08 - 23:12
    referred to as IGs because at Stanford, everything's just short and we just can't
  • 23:12 - 23:14
    say, like, psychology; we have to say psyche.
  • 23:14 - 23:17
    So it's IG. Just remember that, all right?
  • 23:17 - 23:20
    And then how are these things graded? So the other thing we could do is I told you
  • 23:20 - 23:23
    we could just write "B" and hand it back to you.
  • 23:23 - 23:25
    But we found that that's not really great because people get all wrapped
  • 23:25 - 23:27
    around the axle about the grade.
  • 23:27 - 23:31
    And so for a while, we did numbers and we're, like, huh, why don't we give a number between 1 and
  • 23:31 - 23:33
    20? And so what happens there?
  • 23:33 - 23:36
    People get all wrapped around the axle about numbers.
  • 23:36 - 23:39
    So then we thought, huh, what was a happier time when we were in school?
  • 23:39 - 23:43
    I remember when we were in school, and we used to get back assignments and they
  • 23:43 - 23:45
    had, like, smiley faces on them.
  • 23:45 - 23:49
    Well, we can't do that because then it doesn't appear to be a rigorous Stanford
  • 23:49 - 23:49
    class.
  • 23:49 - 23:52
    So instead of the smiley face,
  • 23:52 - 23:54
    we come up with something else,
  • 23:54 - 23:59
    which looks surprisingly like this. It's kind of involved to actually draw, so I need to
  • 23:59 - 24:05
    erase the board to do it. Check.
  • 24:05 - 24:07
    That's kind of the beginning of our grading scale, okay?
  • 24:07 - 24:12
    And the way our grading scale works is we start off with a check in the middle,
  • 24:12 - 24:15
    which says this is a pretty solid program. It meets all the requirements
  • 24:15 - 24:19
    for the program. Maybe it's got a little problem here or there, but it's a check.
  • 24:19 - 24:23
    Then we have sort of two grades on the two sides of it: check plus and check
  • 24:23 - 24:24
    minus.
  • 24:24 - 24:26
    Check plus is, like,
  • 24:26 - 24:27
    solid.
  • 24:27 - 24:32
    You did a great job; you got everything right; things look good, a nice style in
  • 24:32 - 24:36
    your program, nice software engineering, and the program works flawlessly.
  • 24:36 - 24:39
    Good job. This is like total "A."
  • 24:39 - 24:43
    Check is kind of like, yeah, you're sort of there. It's kind of like "A" minus, "B" plus,
  • 24:43 - 24:45
    maybe on some occasions "B."
  • 24:45 - 24:47
    But it's kind of like it's pretty good work; you're in pretty good
  • 24:47 - 24:49
    shape here.
  • 24:49 - 24:52
    And so a lot of grades in this class ends up being check pluses and checks, and if that's
  • 24:52 - 24:55
    the case, you're perfectly fine grade-wise.
  • 24:55 - 24:59
    Check minus, as you can imagine, this is kind of thinking about "B," "B" minus. It's,
  • 24:59 - 25:03
    yeah, there are some slightly more significant problems with your program.
  • 25:03 - 25:05
    But that's not where it ends, right, because we wanna
  • 25:05 - 25:09
    be able to even shoot for in some sense bigger gustoes. There was a plus
  • 25:09 - 25:10
    and a minus.
  • 25:10 - 25:12
    So plus is like,
  • 25:12 - 25:16
    oh, nice job, kind of a hearty
  • 25:16 - 25:18
    pat on the back. If you get
  • 25:18 - 25:21
    pluses all the way through on all your assignments, you're in a pretty good
  • 25:21 - 25:23
    candidate to get an "A" plus.
  • 25:23 - 25:27
    And minus, like, just take good over here and replace it with bad, it's kind of like,
  • 25:27 - 25:28
    oh,
  • 25:28 - 25:32
    bad times, right,
  • 25:32 - 25:37
    or maybe, you know - but
  • 25:37 - 25:40
    even there was, like, more significant problems with this program or just the
  • 25:40 - 25:43
    style on the program is just really bad.
  • 25:43 - 25:47
    But even there, we don't stop. And you're, like, "Come on, man. Like, I thought the whole reason
  • 25:47 - 25:51
    was to simplify this." Don't worry. And it gets even better because we have a plus-plus
  • 25:51 - 25:56
    and a minus-minus. And at this point, we've run out of board space, so we can't go any further.
  • 25:56 - 25:57
    But a plus-plus
  • 25:57 - 25:59
    is just outrageous,
  • 25:59 - 26:02
    right? It's the kind of thing - so this is the kind of thing your section leader can't
  • 26:02 - 26:03
    actually give you
  • 26:03 - 26:06
    without coming and talking to Ben and I first
  • 26:06 - 26:09
    because they get a program that just goes - it has to actually exceed the
  • 26:09 - 26:12
    requirements for the assignment. It's by a long shot.
  • 26:12 - 26:15
    Like, you'll get all your assignment requirements, and what we encourage you
  • 26:15 - 26:18
    to do is you can do a grade assignment and get everything right and have good style,
  • 26:18 - 26:22
    and you'll be in this category. And for the later assignments, you may be in this category if it's
  • 26:22 - 26:22
    flawless.
  • 26:22 - 26:26
    But we'll actually - if you want to go for the plus-plus,
  • 26:26 - 26:29
    go beyond the assignment requirements. And the way we think about the plus-plus, it's a
  • 26:29 - 26:31
    program that makes you weep
  • 26:31 - 26:32
    in a good way.
  • 26:32 - 26:35
    It's just like your section leader sees it, and they're just, like,
  • 26:35 - 26:39
    this is so good, I've gotta show someone else. And they come and show Ben and
  • 26:39 - 26:42
    I, and we're, like, sitting there looking at this on a monitor, and, like, tears are just welling in our eyes, and there was,
  • 26:42 - 26:43
    like,
  • 26:43 - 26:47
    soft violin music playing in the background and we get out the wine and
  • 26:47 - 26:48
    cheese.
  • 26:48 - 26:53
    So this is just, like, this is the kind of thing that gets you, like,
  • 26:53 - 26:56
    remembered and the, oh, if you want a letter of recommendation, just ask because you got
  • 26:56 - 26:59
    a plus-plus. Like, oh,
  • 26:59 - 27:03
    it's awesome, right? There are very few of these in a quarter. So just by sort of
  • 27:03 - 27:06
    way of comparison, in a class this size, probably throughout the span of the
  • 27:06 - 27:10
    whole quarter, I'd expect there to be maybe ten plus-pluses,
  • 27:10 - 27:14
    I mean, ten assignment plus-pluses, not ten students who get plus-pluses across the
  • 27:14 - 27:14
    board.
  • 27:14 - 27:17
    So it's really something to strive for, but if you strive for it,
  • 27:17 - 27:21
    like, we're giving you the credit for it. And this gets remembered and you get, like,
  • 27:21 - 27:23
    extra credit and everything.
  • 27:23 - 27:25
    So we're left with this,
  • 27:25 - 27:30
    right? This assignment also makes you weep,
  • 27:30 - 27:33
    but not in the good way, right? It makes you kind of weep in the sense, like, I look at
  • 27:33 - 27:35
    them and I'm, like,
  • 27:35 - 27:39
    oh, man, like, what did I teach? Like, where did I go wrong, right? I, like,
  • 27:39 - 27:41
    blame myself.
  • 27:41 - 27:45
    I blame you a little bit, but I blame myself.
  • 27:45 - 27:47
    And this is really just, like, the program is just, like, it's a
  • 27:47 - 27:51
    shell. Like, there really wasn't much effort that was put into it. Yeah, you slapped something together
  • 27:51 - 27:53
    or it doesn't really work,
  • 27:53 - 27:56
    that whole deal. And then if you don't turn anything in, we do kind of reserve the
  • 27:56 - 27:59
    zero to distinguish from the
  • 27:59 - 28:03
    "made really bad effort" versus "didn't make any effort at all."
  • 28:03 - 28:06
    And we just won't talk about these, right? Let's just hope we can avoid those
  • 28:06 - 28:10
    if possible. But that's kind of how the grading scale works now. Now,
  • 28:10 - 28:14
    at the same time, I trust all of you to be responsible people.
  • 28:14 - 28:17
    And every once in a while, something bad happens to a good person, and
  • 28:17 - 28:21
    there's an assignment that you'd like to be able to turn in, but for whatever reason, you
  • 28:21 - 28:24
    can't turn in on time. And I just wanna treat you like adults.
  • 28:24 - 28:28
    I don't want you to have to worry about coming in and asking for an extension
  • 28:28 - 28:31
    or, like, "Oh, I had this really hard thing in another class, and I couldn't do it at the same time." Up
  • 28:31 - 28:32
    front,
  • 28:32 - 28:34
    everyone gets two free extensions, okay? So
  • 28:34 - 28:39
    in terms of late days - we refer to these as late days, strangely enough - you
  • 28:39 - 28:41
    get two free ones.
  • 28:41 - 28:44
    What a late day is, is a class day. They're not 24-hour days, but class days.
  • 28:44 - 28:48
    So if something is due on a Wednesday, you turned in on a Friday, that's a late
  • 28:48 - 28:49
    day. That's one.
  • 28:49 - 28:52
    You turn it in on the following Monday, that's two late days.
  • 28:52 - 28:55
    You can split up your two late days among two different assignments. You can use
  • 28:55 - 28:56
    them both on one assignment.
  • 28:56 - 29:00
    But we encourage you to not use them at all because if you use your late days, you fall behind
  • 29:00 - 29:01
    in the class.
  • 29:01 - 29:05
    The way you should think about these things are these are pre-approved extensions.
  • 29:05 - 29:08
    They're not the kind of thing where you just think, "Oh, yeah, I'm not gonna do the
  • 29:08 - 29:11
    assignment because I wanna go and play Frisbee golf," right?
  • 29:11 - 29:14
    Think of it, well, you wouldn't come ask me for an extension - you might, but you probably wouldn't
  • 29:14 - 29:18
    ask me for an extension if you're, like, "Hey, hey, Mehran, can I turn in the
  • 29:18 - 29:20
    assignment, like, on Wednesday because
  • 29:20 - 29:23
    I'm playing Frisbee golf this afternoon," right? If you would feel embarrassed
  • 29:23 - 29:26
    asking that question, you probably don't wanna use one of your free late days.
  • 29:26 - 29:27
    But something happens like,
  • 29:27 - 29:31
    oh, it's a tough week, you've got midterms in other classes and you got this assignment
  • 29:31 - 29:33
    due or whatever, that's a good time to use it.
  • 29:33 - 29:36
    So we just trust you. And most people, we actually encourage you not to use them
  • 29:36 - 29:39
    because it just makes you fall behind in the class.
  • 29:39 - 29:42
    Because we trust you and we give you these two up front, getting extensions
  • 29:42 - 29:46
    beyond your two free class days is virtually impossible because we sort of
  • 29:46 - 29:47
    up front said,
  • 29:47 - 29:49
    hey, it's your responsibility. We're giving you two freebies.
  • 29:49 - 29:52
    We're not gonna give you a third extension. Imagine if you had to come ask us for three
  • 29:52 - 29:56
    extensions. By the third one, we'd be, like, okay, what's going on, which is why
  • 29:56 - 29:58
    we don't necessarily give extensions beyond these two.
  • 29:58 - 30:01
    The only time we might give an extension beyond the two free ones is for
  • 30:01 - 30:02
    something major, like
  • 30:02 - 30:06
    death in the family or, like, serious medical problems that might require surgery or
  • 30:06 - 30:07
    something like that.
  • 30:07 - 30:10
    Every once in a while, unfortunately, that happens. I hope it doesn't happen in this
  • 30:10 - 30:11
    class.
  • 30:11 - 30:14
    But those are the only kinds of things that we give extensions to beyond the two
  • 30:14 - 30:15
    free late days.
  • 30:15 - 30:19
    Importantly, don't ask your section leader for extensions. They cannot grant you
  • 30:19 - 30:22
    extensions. Only Ben, who has all the power in this class, can give extensions, which
  • 30:22 - 30:25
    is why you should get to know Ben and then hopefully you won't need to talk to him about
  • 30:25 - 30:28
    extensions, okay? So
  • 30:28 - 30:32
    other thing to keep in mind is that three days late is the max.
  • 30:32 - 30:36
    Beyond three days late, which is basically one class week, if you think
  • 30:36 - 30:39
    about late days being class days, we will not accept an assignment. And the reason
  • 30:39 - 30:42
    for that is at a certain point, you're so late, you're better off just doing the
  • 30:42 - 30:44
    next assignment, letting the old one go.
  • 30:44 - 30:48
    So to sort of enforce that policy, after three days, we don't accept that
  • 30:48 - 30:51
    assignment late anymore. It's just gonna be a zero if it's not turned in, okay?
  • 30:51 - 30:53
    And that just kind of forces you to keep up.
  • 30:53 - 30:57
    Couple other minor things, well, I shouldn't say they're minor things. They're actually kind of important. Exams: There's
  • 30:57 - 31:00
    two exams in this class. There's a midterm and a final.
  • 31:00 - 31:04
    Both of them are, well, I shouldn't say both. The midterm is out of class. It's
  • 31:04 - 31:08
    from 7:00 to 8:30 p.m.
  • 31:08 - 31:13
    on Tuesday, October 30. And it's on the syllabus. It's there. It's on the syllabus; it's
  • 31:13 - 31:17
    on Handout No. 1. We repeat it multiple times. The date will eventually be announced
  • 31:17 - 31:18
    when we get close to the midterm.
  • 31:18 - 31:22
    But if you have a conflict with this time, you need to send me email, okay?
  • 31:22 - 31:27
    You can send me email a little closer to the midterm because I'll announce it again for people who have
  • 31:27 - 31:27
    conflicts.
  • 31:27 - 31:32
    But since it's an out-of-class exam, you need to send me email if you have a conflict.
  • 31:32 - 31:35
    I'll get all the constraints from people who have conflicts and try to schedule an
  • 31:35 - 31:37
    alternate time if there's enough people with conflicts.
  • 31:37 - 31:41
    But 7:00 to 8:30 is when you need to know about the midterm. And to make up for
  • 31:41 - 31:43
    the fact that we have an out-of-class midterm, I actually give you sort of
  • 31:43 - 31:47
    a belated free day, which is the Friday of the week of the midterm, we don't have
  • 31:47 - 31:50
    class to make up for the fact that we made you come to the midterm outside of class.
  • 31:50 - 31:53
    But the midterm's an hour and a half, and we can't compress time. If we could, we'd
  • 31:53 - 31:54
    have different issues.
  • 31:54 - 31:57
    We can't compress time and fit it into a 50 minute class, which is why it's
  • 31:57 - 31:59
    out of class, but you get a free day for it,
  • 31:59 - 32:02
    all right? Last but not least,
  • 32:02 - 32:04
    few things about grading.
  • 32:04 - 32:06
    Grading, one of those things as you might be able to tell from this little board
  • 32:06 - 32:10
    over here or something, if I didn't have to do it, I wouldn't do it
  • 32:10 - 32:14
    because honestly, as corny as this sounds, I just believe in the love of learning.
  • 32:14 - 32:17
    Like, I think if you're passionate about something, you just go do it and you
  • 32:17 - 32:18
    learn it.
  • 32:18 - 32:22
    But I'm na?ve, and so that's not the way learning always works. So sometimes we
  • 32:22 - 32:25
    actually need grading to make sure that learning takes place. And so this is how your
  • 32:25 - 32:26
    grade breaks down:
  • 32:26 - 32:31
    Forty-five percent of your grade is on the programming assignments, okay?
  • 32:31 - 32:35
    Fifteen percent is the midterm, which we'll just call the mid because we like to
  • 32:35 - 32:36
    abbreviate everything.
  • 32:36 - 32:41
    Thirty percent is the final. It's a three-hour final exam in the regular final
  • 32:41 - 32:43
    time slot for this class.
  • 32:43 - 32:46
    If you think or are under the delusion that you should take two
  • 32:46 - 32:47
    classes at the same time,
  • 32:47 - 32:50
    that's a bad idea because their final exams are at the same time,
  • 32:50 - 32:54
    okay? So you should not take two classes as the same time
  • 32:54 - 32:58
    because our final exam is scheduled for - I believe it's December 13, which
  • 32:58 - 32:58
    is a
  • 32:58 - 33:02
    Thursday, 12:15 to 3:15. That's the regular final exam slot for
  • 33:02 - 33:05
    this class. And any other class at the same time will conflict with that slot. Thirty
  • 33:05 - 33:09
    percent of your grade is the final. And that, if you add it all up,
  • 33:09 - 33:13
    it's not just that I'm bad with math. It's because 10 percent of your grade is actually
  • 33:13 - 33:16
    participation. And this is things like
  • 33:16 - 33:19
    did you go to your interactive grading sessions? Did you regularly attend
  • 33:19 - 33:23
    section? Did you participate in section? Did you participate in class, right?
  • 33:23 - 33:26
    And so, in order to help you participate in class,
  • 33:26 - 33:30
    there's a little incentive to participate in class, which is sugar in the afternoon.
  • 33:30 - 33:33
    So someone raise their hand. All
  • 33:33 - 33:36
    right.
  • 33:36 - 33:38
    Yeah, sometimes I'm not a good shot. And this will tell you, if you're sitting in
  • 33:38 - 33:43
    the back of the room, I can't throw a Kit Kat back there because they're a little
  • 33:43 - 33:45
  • 33:45 - 33:45
    too light. Oh, yeah, sorry.
  • 33:45 - 33:49
    If you sit in the back of the room, the roof prevents me from actually being able to hit
  • 33:49 - 33:53
    you. So if you want the food, come up. But if you ask questions in class,
  • 33:53 - 33:57
    hey, that's a good time. It's just a little way to be able to reward you for
  • 33:57 - 33:58
    actually participating in class
  • 33:58 - 34:01
    or to keep your blood sugar up if you need it, all right?
  • 34:01 - 34:05
    So that's participation. It's 10 percent of your grade, and as a matter of fact, at the end of the quarter, I ask
  • 34:05 - 34:09
    every one of your section leaders to actually tell me how much you participated in class, and
  • 34:09 - 34:12
    some of them just say, "Oh, this person was wonderful. They came every time. They participated.
  • 34:12 - 34:13
    It's just a great thing."
  • 34:13 - 34:16
    And that helps your grade out a lot, okay?
  • 34:16 - 34:17
    Now, the final thing,
  • 34:17 - 34:19
    and as you can kind of tell,
  • 34:19 - 34:21
    most of the time, I'm not the most serious person in the world. I just like
  • 34:21 - 34:24
    to have fun with things, and I think it's important for you to have fun with
  • 34:24 - 34:25
    things.
  • 34:25 - 34:28
    There is just one place where I get real serious, and it's one place where Stanford
  • 34:28 - 34:30
    gets real serious.
  • 34:30 - 34:33
    Anyone wanna guess what that is?
  • 34:33 - 34:36
    Plagiarism and the honor code. As a matter of fact, that's what we call a social. So we
  • 34:36 - 34:39
    had someone down here who got it and then a whole bunch of people who I don't
  • 34:39 - 34:45
    know, so we just spray. All right.
  • 34:45 - 34:48
    So the honor code,
  • 34:48 - 34:50
    in terms of the honor code, the
  • 34:50 - 34:55
    question comes up is what is the honor code all about, and how does that affect working
  • 34:55 - 34:58
    in groups and computer science, etc.?
  • 34:58 - 35:00
    Does that mean we shouldn't talk to each other?
  • 35:00 - 35:04
    No. The answer to all those is no, okay? If you look at Handout No. 4,
  • 35:04 - 35:06
    which is all about the honor code,
  • 35:06 - 35:09
    we encourage you to talk to each other. We encourage you to talk about concepts
  • 35:09 - 35:12
    in the class, talk about different strategies to problems, to think about
  • 35:12 - 35:15
    the ways that you could potentially approach some problem or
  • 35:15 - 35:18
    the way different control constructs when we eventually get to them work in the
  • 35:18 - 35:21
    class. And discussion is perfectly fine,
  • 35:21 - 35:24
    especially among the course staff, but also amongst yourselves. That's a great
  • 35:24 - 35:25
    thing.
  • 35:25 - 35:28
    So where do we draw the line? And we try to make a bright line for where you've
  • 35:28 - 35:32
    crossed the line for the honor code, which is
  • 35:32 - 35:35
    don't share code,
  • 35:35 - 35:36
    plain and simple,
  • 35:36 - 35:38
    in any respect, okay?
  • 35:38 - 35:42
    Don't give a file to someone else that's got your code in it. Don't get code
  • 35:42 - 35:45
    from someone else. Don't look at someone else's printout. Don't give them a
  • 35:45 - 35:46
    printout.
  • 35:46 - 35:49
    If you have two people who are sitting looking at the same screen together,
  • 35:49 - 35:51
    that code can't belong to both of you.
  • 35:51 - 35:52
    It belongs to one of you.
  • 35:52 - 35:56
    I don't know which one, but it becomes an honor code violation. So you shouldn't
  • 35:56 - 35:59
    both - two people shouldn't be staring at the monitor together.
  • 35:59 - 36:03
    If it ever gets to the point where you're looking at someone else's code, that's
  • 36:03 - 36:05
    where you're gonna reach an issue, okay?
  • 36:05 - 36:07
    Discuss as much as you want. That's great.
  • 36:07 - 36:10
    Write your own code. That's all we care about. And you're, like, "Well, what is
  • 36:10 - 36:15
    code, Mehran? What does that word mean?" Code is geek speak for your program,
  • 36:15 - 36:18
    so when you program, the program that you write is what we affectionately refer to
  • 36:18 - 36:19
    as code.
  • 36:19 - 36:23
    And the idea of programming is what we refer to as coding,
  • 36:23 - 36:26
    strangely enough. Computer scientists need to make everything
  • 36:26 - 36:28
    more complicated than it really is so we can
  • 36:28 - 36:31
    get people under the illusion that they should pay us lots of money to do what we do.
  • 36:31 - 36:35
    I mean, you're, like, "Oh, I just write programs." And they're, like, "Oh, yeah, I should pay you
  • 36:35 - 36:38
    half." And you're, like, "No, no, no. I write code." And they're, like, "Oh, yeah." Suddenly, it's much more
  • 36:38 - 36:40
    impressive. So
  • 36:40 - 36:41
    don't share code.
  • 36:41 - 36:45
    The other thing is if you talk to other people, like if you have a study group to
  • 36:45 - 36:48
    talk about solution approaches or you go, let's say, talk to the TA or your section
  • 36:48 - 36:49
    leader
  • 36:49 - 36:51
    to how you should approach a problem, and they give you a lot of hints as to how
  • 36:51 - 36:53
    to do it,
  • 36:53 - 36:56
    cite collaboration.
  • 36:56 - 37:00
    So cite and collaboration gets you out of trouble. Any collaboration that you cite
  • 37:00 - 37:03
    you cannot be held responsible for under the honor code.
  • 37:03 - 37:07
    You can actually copy someone else's program and say, "I copied this program
  • 37:07 - 37:08
    from Mary Smith."
  • 37:08 - 37:10
    And I'll look at that and say,
  • 37:10 - 37:13
    "They cited it," and it will warm the cockles of my heart.
  • 37:13 - 37:16
    And Mary Smith will get full credit, and you'll get a zero because you copied your
  • 37:16 - 37:17
    program from Mary Smith,
  • 37:17 - 37:22
    but it's not an honor code violation because you cited the work, okay? So
  • 37:22 - 37:27
    the bottom line is keep yourself safe and cite your collaborations. And I
  • 37:27 - 37:29
    guarantee you most of the time, you'll be just fine.
  • 37:29 - 37:32
    Now, you might wonder why do I make such a big deal about this. And the reason I
  • 37:32 - 37:35
    make a big deal about this is for a while, thankfully it's not true anymore, but
  • 37:35 - 37:36
    for a while,
  • 37:36 - 37:40
    the computer science department actually had more honor code violations than the
  • 37:40 - 37:43
    rest of the university combined.
  • 37:43 - 37:46
    Take everything else in the university, put them all together, they were like over
  • 37:46 - 37:49
    here. And we're, like, we're computer science,
  • 37:49 - 37:52
    which is not a fun distinction to have, let me tell you.
  • 37:52 - 37:55
    And you might wonder why is that? Is that because computer science people are just
  • 37:55 - 37:58
    mischievous and dishonest? No.
  • 37:58 - 38:02
    It's because it's easier to catch honor code violations in computer science. We have a
  • 38:02 - 38:05
    whole bunch of tools that allow us - then we take all your programs and we run them through
  • 38:05 - 38:08
    this tool, and it compares them not only to everyone else in here, but, like,
  • 38:08 - 38:11
    to everyone from the last, like, X years where X is the large number of people who've
  • 38:11 - 38:13
    ever gone through the classes, right?
  • 38:13 - 38:17
    And it's an extremely good tool from finding where honor code violations
  • 38:17 - 38:17
    happen,
  • 38:17 - 38:19
    from where they don't. And it
  • 38:19 - 38:23
    doesn't find spurious violations. To be honest, I've never lost an honor code
  • 38:23 - 38:24
    case. When I
  • 38:24 - 38:26
    find an honor code case,
  • 38:26 - 38:28
    it is blatant.
  • 38:28 - 38:30
    And you take it to judicial affairs, and they look at it, and they're, like,
  • 38:30 - 38:31
    yeah, this is blatant.
  • 38:31 - 38:34
    And I take it to the student, and every student I've ever confronted them
  • 38:34 - 38:38
    with never said, "No, no, no. I didn't cheat." They said, "You caught me," okay?
  • 38:38 - 38:42
    So it's blatant. It's not like, oh, there's some little line in it, "Oh, am I gonna need to
  • 38:42 - 38:44
    worry about an honor code violation?"
  • 38:44 - 38:47
    Remember those rules, you have nothing to worry about in this class. It's people who go and,
  • 38:47 - 38:51
    like, fish out printouts from the recycle bins and copy other people's
  • 38:51 - 38:53
    code that are the people we catch, right? It's blatant cheating
  • 38:53 - 38:54
    that we catch.
  • 38:54 - 38:55
    But we catch it.
  • 38:55 - 38:59
    We catch it all the time. So I hope, I pray it doesn't happen in this class.
  • 38:59 - 39:02
    But the reason I make a big deal about it is historically if I look at the
  • 39:02 - 39:06
    evidence, it happens and we catch it. And when we catch it, we're required by the
  • 39:06 - 39:09
    university to prosecute. And I feel bad because usually it's someone who just made a
  • 39:09 - 39:10
    bad call, like,
  • 39:10 - 39:13
    they were up way too late the night before working on something else, and
  • 39:13 - 39:17
    they're not thinking straight. And rather than just taking a late day or turning in their
  • 39:17 - 39:20
    assignment late and getting a slight penalty on it beyond their two free late
  • 39:20 - 39:20
    days,
  • 39:20 - 39:23
    they decide to cheat. And that's just always the wrong call, okay?
  • 39:23 - 39:27
    So you just don't wanna put yourself in that situation. So I get real serious
  • 39:27 - 39:32
    about it for a moment, and hopefully it won't be an issue and we can just kind of go on, okay?
  • 39:32 - 39:35
    So with that said, that's a whole bunch of logistical stuff.
  • 39:35 - 39:38
    Any questions about the logistics of this class or anything I just talked
  • 39:38 - 39:43
    about? Uh huh? You had briefly mentioned the late penalty.
  • 39:43 - 39:44
    Oh, the late penalty, good point.
  • 39:44 - 39:46
    So remember our little bucket scale.
  • 39:46 - 39:50
    If you go beyond your two free late days, every day you turn in an assignment late beyond
  • 39:50 - 39:52
    those, it drops down one bucket.
  • 39:52 - 39:56
    So let's say you already used your two free late days on Assignment No. 1. And on
  • 39:56 - 39:58
    Assignment No. 2, you turned in something one day late and you would have gotten a
  • 39:58 - 40:00
    check normally, it becomes a check minus.
  • 40:00 - 40:06
    So that's how it is. It's one bucket per late day beyond your two free ones. Uh huh? Are the sections first come, first served?
  • 40:06 - 40:09
    Yeah, the sign-ups, well, they take into consideration your preference, but
  • 40:09 - 40:12
    part of your preference is to do the match is first come, first served.
  • 40:12 - 40:15
    So you wanna sign up early.
  • 40:15 - 40:16
    Oh,
  • 40:16 - 40:18
    thanks for your honesty. As a matter of fact,
  • 40:18 - 40:21
    I dig honesty, all right?
  • 40:21 - 40:24
    Any other questions?
  • 40:24 - 40:29
    It's just honesty's cool. Uh huh? How much time should we plan on studying [inaudible]?
  • 40:29 - 40:32
    Oh, good question. How much time should you plan? And this is something that I say for
  • 40:32 - 40:34
    classes in general at Stanford, which is not always true,
  • 40:34 - 40:38
    which is take the number of units that a class is,
  • 40:38 - 40:43
    multiply it by three. That's how many hours you'll spend per week in that class, total,
  • 40:43 - 40:44
    on average.
  • 40:44 - 40:48
    So what that means is in 106A, a 5 unit class, you multiply by 3, you
  • 40:48 - 40:49
    get 15.
  • 40:49 - 40:52
    Five of those hours are roughly spent between class, section, interactive grading,
  • 40:52 - 40:53
    other stuff.
  • 40:53 - 40:57
    That means on average about ten hours a week will be spent on your assignments
  • 40:57 - 40:58
    in this class.
  • 40:58 - 41:02
    Again, that's an average. Sometimes when I go to computer science conferences, I sit there and joke
  • 41:02 - 41:04
    around with plans. And we're, like, "Oh, how long did your assignments take?"
  • 41:04 - 41:08
    And I say, "Oh, on average, ten hours." And what I really mean when I say on average 10
  • 41:08 - 41:08
    hours
  • 41:08 - 41:11
    is they take between 3 and 45,
  • 41:11 - 41:14
    okay? It's a large variance event, right?
  • 41:14 - 41:17
    Ten is the average. Some people take a really long time. Some people get through it
  • 41:17 - 41:21
    really quickly, but that's about the average you can plan for. Uh huh?
  • 41:21 - 41:28
    Another question? [Inaudible] late days [inaudible] class days?
  • 41:28 - 41:32
    Yeah, all late days are class days, so the free ones -
  • 41:32 - 41:36
    the halfway mark's really my reach. That's about it.
  • 41:36 - 41:40
    All right. So I do wanna give you your very beginning of an introduction to
  • 41:40 - 41:43
    programming before we sort of break for the day. How
  • 41:43 - 41:46
    are we doing on time?
  • 41:46 - 41:49
    And so in order to kind of see this,
  • 41:49 - 41:52
    there's a few things that we wanna keep in mind. Actually, let me show you a
  • 41:52 - 41:55
    little picture, okay?
  • 41:55 - 41:57
    Sometimes
  • 41:57 - 41:59
    when we talk about writing programs,
  • 41:59 - 42:02
    we talk about debugging programs,
  • 42:02 - 42:05
    right? How many people ever heard the term debugging or bugs in programs?
  • 42:05 - 42:08
    A bug in a program is an error in a program, so sometimes when you hear us
  • 42:08 - 42:13
    say, "Oh, come see," like, your section leader to help debug or see the helpers in LaIR.
  • 42:13 - 42:16
    That's another thing. In the Tresidder computer cluster is the LaIR.
  • 42:16 - 42:19
    It's a computer cluster that we have helpers there to help you get through
  • 42:19 - 42:21
    this class. What is it?
  • 42:21 - 42:22
    Sunday through
  • 42:22 - 42:27
    Thursday, every week, from around 2:00 in the afternoon 'til midnight every day, okay,
  • 42:27 - 42:30
    to help you get through the class. So that's a good place if, you know, you can
  • 42:30 - 42:33
    work in your dorm room certainly, but if you also want help, go to the Tresidder
  • 42:33 - 42:36
    computer cluster, and there will be helpers there. There's a little queue you sign up for
  • 42:36 - 42:39
    to get help, and that's a great place, and it's all explained in Handout
  • 42:39 - 42:39
    No. 1,
  • 42:39 - 42:41
    but that's just something to keep in mind.
  • 42:41 - 42:45
    Where the term debugging comes from, it turns out this is an apocryphal story, but I'll tell
  • 42:45 - 42:45
    you anyway.
  • 42:45 - 42:49
    Back in the days of yore, in 1945 actually, there was a computer called the
  • 42:49 - 42:52
    Mark II at Harvard. And there was a woman named Grace Murray Hopper. Anyone ever
  • 42:52 - 42:54
    heard of Grace Murray Hopper?
  • 42:54 - 42:58
    A few folks. She was actually the first woman who was an admiral in the navy.
  • 42:58 - 43:02
    And she was also one of the very early pioneers of computer programming. She did
  • 43:02 - 43:05
    a lot of computer programming when she was actually a captain, and she was stationed
  • 43:05 - 43:09
    at Harvard as part of some sort of navy thing. I don't know why, but that's what
  • 43:09 - 43:09
    happened.
  • 43:09 - 43:12
    And they had this huge computer there, and they were noticing the computer was
  • 43:12 - 43:15
    on the fritz, and they couldn't understand what was wrong. And this is one of these
  • 43:15 - 43:18
    big old machines in the days of yore that has vacuum tubes and stuff inside it.
  • 43:18 - 43:21
    So they walked inside the computer, right, because then you could actually open it up
  • 43:21 - 43:23
    and walk inside your computer.
  • 43:23 - 43:25
    And they saw this,
  • 43:25 - 43:28
    and I don't know if you can see that, but that's a moth.
  • 43:28 - 43:32
    It was a moth that had sort of given its life to be immortalized because it had actually
  • 43:32 - 43:35
    shorted out across two relays in the computer
  • 43:35 - 43:37
    and was causing these sort of
  • 43:37 - 43:40
    errors to happen on the fritz. And so they took the bug out, and once
  • 43:40 - 43:43
    they actually plucked this little charred bug out of there, the computer started
  • 43:43 - 43:48
    working fine again, and she taped it in her log book. And this log book's actually
  • 43:48 - 43:52
    preserved in the Smithsonian Institution now, which is where all this comes
  • 43:52 - 43:55
    from. Here's all the standard disclaimer information: "Image used under fair use for
  • 43:55 - 43:58
    education purposes. Use of this image is exempt from Creative Commons
  • 43:58 - 44:00
    and other licenses," just so you know.
  • 44:00 - 44:02
    Now the lawyers are happy.
  • 44:02 - 44:06
    But this is where we think of sort of the modern term debugging actually came from.
  • 44:06 - 44:09
    Now, it turns out the actual story is that the term debugging came from the
  • 44:09 - 44:11
    1800s, in the late 1800s
  • 44:11 - 44:15
    from mechanical devices. People actually referred to debugging as fixing mechanical
  • 44:15 - 44:16
    devices.
  • 44:16 - 44:20
    But this is kind of the apocryphal story for how it comes up in computer science. Now,
  • 44:20 - 44:22
    with that said,
  • 44:22 - 44:25
    what is the platform in which you're gonna sort of do your first debugging or
  • 44:25 - 44:28
    your first work on? We talked about Java, but in fact in this class, we're not
  • 44:28 - 44:29
    gonna start with Java.
  • 44:29 - 44:33
    We're gonna start with something even sort of simpler than Java because as I
  • 44:33 - 44:36
    mentioned, sometimes what happens in computer science is people learn all the features
  • 44:36 - 44:40
    of some language. And they think just knowing the language makes them a good
  • 44:40 - 44:41
    software engineer.
  • 44:41 - 44:44
    And they get so worried about all the features of the language
  • 44:44 - 44:46
    that they don't kind of think about the big picture.
  • 44:46 - 44:49
    And so there was a guy named Rich Pattis, who oddly enough was actually a grad
  • 44:49 - 44:51
    student at the time at
  • 44:51 - 44:52
    Stanford,
  • 44:52 - 44:55
    and he said, "You know what? If we're gonna teach computer science, when we first start out, why don't
  • 44:55 - 44:59
    we have people not worry about all of the different
  • 44:59 - 45:01
    commands of the language and all the different things they can do?
  • 45:01 - 45:04
    Let's start with something really simple so you can learn all the commands
  • 45:04 - 45:08
    real quick. And then you've mastered everything there is to master about that
  • 45:08 - 45:12
    language, and you can focus on the software engineering concepts." And it turns out to
  • 45:12 - 45:15
    be a brilliant idea, which has actually been adopted by a bunch of people.
  • 45:15 - 45:19
    And so Rich, who's a wonderfully friendly guy - sometime if we get him to
  • 45:19 - 45:23
    come to Stanford, I'll introduce you; he's just very nice -
  • 45:23 - 45:27
    came up with this thing called Karel the Robot. And
  • 45:27 - 45:29
    the term, "Karel"
  • 45:29 - 45:32
    actually comes from
  • 45:32 - 45:36
    Karel Capek.
  • 45:36 - 45:40
    Anyone know who he is? Oh, free candy. Uh huh? He coined the term,
  • 45:40 - 45:43
    "robot."
  • 45:43 - 45:46
    He coined the term, "robot." He was a Czech playwright who actually wrote a play
  • 45:46 - 45:48
    called, "RUR,"
  • 45:48 - 45:52
    which was about robots. And the word robot actually comes from a Czech word, the
  • 45:52 - 45:54
    Czech word for work.
  • 45:54 - 45:58
    And so the robot is named after
  • 45:58 - 46:01
    Karel. And some people say Karl, which is kind of actually closer to I believe if - I
  • 46:01 - 46:04
    don't know if there's anyone who speaks Czech in the room - but closer to the
  • 46:04 - 46:06
    actual pronunciation. But we say Karel these days because it's kind of like
  • 46:06 - 46:08
    gender neutral, okay?
  • 46:08 - 46:10
    And so Karel the Robot
  • 46:10 - 46:13
    is basically this robot that lives in a really simple world. And so I'll show you
  • 46:13 - 46:16
    all that you can meet Karel the Robot. He's friendly; he's fun.
  • 46:16 - 46:19
    I'll show you Karel the Robot.
  • 46:19 - 46:21
  • 46:21 - 46:26
    So we gotta get Karel running. He's at the factory. He's getting souped up. We're energizing Karel.
  • 46:26 - 46:29
    You gotta add some color to it. Otherwise -
  • 46:29 - 46:31
    all right.
  • 46:31 - 46:35
    We're begging for him. Come on, Karel.
  • 46:35 - 46:37
    There he is. Oh,
  • 46:37 - 46:42
    yeah.
  • 46:42 - 46:45
    That's Karel the Robot. He looks like one of the old Macintoshes if you remember the original
  • 46:45 - 46:48
    Macintoshes that look like a lunch pail, except he's got legs.
  • 46:48 - 46:52
    One sticks out his back. That's just the way it is.
  • 46:52 - 46:57
    And the way Karel works is he lives in a grid. To you, it may not be exciting, but to
  • 46:57 - 46:59
    Karel, it's way exciting.
  • 46:59 - 47:03
    So Karel lives in this little grid, and the way the grid works is there are streets and
  • 47:03 - 47:07
    avenues in the grid. Streets run horizontally, so this is First Street,
  • 47:07 - 47:08
    Second Street, Third Street.
  • 47:08 - 47:12
    And then over here, we have avenues, First Avenue, Second Avenue, Third
  • 47:12 - 47:15
    Avenue, Fourth Avenue, Fifth Avenue. It's kind of like Karel lives in Manhattan if you wanna
  • 47:15 - 47:16
    think about it that way, okay?
  • 47:16 - 47:20
    So Karel always is on one of these corners. So right now, he's at the corner of
  • 47:20 - 47:23
    First Street and First Avenue, or we just refer to it as 1 1 if you wanna
  • 47:23 - 47:25
    think about sort of Cartesian coordinates, right? But
  • 47:25 - 47:27
    just think of them as streets and avenues.
  • 47:27 - 47:29
    That's where Karel lives.
  • 47:29 - 47:32
    And Karel can move around in this world. There's a bunch of things that Karel can do.
  • 47:32 - 47:34
    He can take steps forward.
  • 47:34 - 47:37
    He can turn around to face different directions, and he can sense certain
  • 47:37 - 47:38
    things about his world.
  • 47:38 - 47:41
    So there's some things that exist in Karel's world, okay?
  • 47:41 - 47:45
    Things like walls that Karel cannot move through, right, so his world has
  • 47:45 - 47:49
    walls all around it that he can't go through, so he can't fall off the end of the
  • 47:49 - 47:49
    world.
  • 47:49 - 47:53
    And there's other walls like this one if Karel were over here, he can't step through
  • 47:53 - 47:54
    that wall.
  • 47:54 - 47:58
    There's also something referred to as beepers in Karel's world. And what a
  • 47:58 - 48:00
    beeper is, is it's like a big diamond,
  • 48:00 - 48:04
    okay? But what a beeper really is, is basically just some marker that he puts in
  • 48:04 - 48:07
    the world. You can think of a beeper like a piece of candy.
  • 48:07 - 48:11
    And Karel just goes around, like, putting pieces of candy in the world. As a matter of fact, not
  • 48:11 - 48:13
    only does he put pieces of candy in the world,
  • 48:13 - 48:18
    he carries around a whole bag of candy. So he has a beeper bag with him, and
  • 48:18 - 48:21
    sometimes that bag has a whole bunch of beepers in it; sometimes it only has one
  • 48:21 - 48:22
    beeper; sometimes,
  • 48:22 - 48:26
    it's sad Karel, and he has no beepers. But he's still got the bag.
  • 48:26 - 48:29
    There just don't happen to be any beepers in it. So he can potentially, if he
  • 48:29 - 48:33
    come across a beeper in his world, he can pick it up and put it in his bag,
  • 48:33 - 48:36
    or he can take, if he's got beepers in his bag, he can take them out of his bag
  • 48:36 - 48:37
    and put them places in the world.
  • 48:37 - 48:41
    And corners in the world can have either zero - if they have no beepers, they just appear
  • 48:41 - 48:42
    like a little dot -
  • 48:42 - 48:44
    or one or more beepers
  • 48:44 - 48:47
    on them that Karel can potentially pick up, okay?
  • 48:47 - 48:51
    So any questions about beepers or Karel having a little bag of beepers?
  • 48:51 - 48:52
    And that's it.
  • 48:52 - 48:54
    That's Karel.
  • 48:54 - 48:57
    That's his world. His world, we can make it larger if we want. We can put in walls in
  • 48:57 - 49:00
    different places. We can put beepers in different places. We can have Karel be in a
  • 49:00 - 49:01
    different place.
  • 49:01 - 49:05
    But starting next time, what you're gonna realize is with this extremely simple world,
  • 49:05 - 49:09
    there's actually some complicated things you can do. And after about a week - so
  • 49:09 - 49:12
    this first week, we're gonna focus on Karel - you'll notice that Karel is
  • 49:12 - 49:16
    actually a very nice, gentle introduction into Java. And a lot of the concepts that
  • 49:16 - 49:20
    we learn, sort of software engineering concepts using Karel, will translate over to the
  • 49:20 - 49:22
    Java world, okay?
  • 49:22 - 49:25
    So any questions about Karel or any of the other logistics that you've actually
  • 49:25 - 49:29
    heard about in the class?
  • 49:29 - 49:34
    Alrighty then. Welcome to 106A. I'll see you on Wednesday.
Title:
Lecture 1 Programming Methodology (Stanford)
Description:

If you like it please subscribe my channel. Scientifically Proven Way to Be Incredibly Happy. Thanks!

more » « less
Video Language:
English

English subtitles

Incomplete

Revisions