0:00:11.519,0:00:14.778 This presentation is delivered by the Stanford Center for Professional 0:00:14.778,0:00:21.778 Development. 0:00:22.609,0:00:25.029 So welcome to CS106A. 0:00:25.028,0:00:28.419 If you don't think you should be in CS106A, you think you should be somewhere 0:00:28.419,0:00:30.679 different, now is probably a good time 0:00:30.678,0:00:33.838 to go, not that I would discourage anyone from taking this class. I think we'll have a lovely 0:00:33.838,0:00:34.988 time in here. 0:00:34.988,0:00:39.759 But this class is CS106A or E70A, so if you're, 0:00:39.759,0:00:43.058 like, "Wait. I thought I was in E70A," you're fine. They're the same class; it's the 0:00:43.058,0:00:45.280 same thing. No worries, 0:00:45.280,0:00:48.689 okay? There's four handouts. They're in the back. If you haven't already gotten the handouts because you came in and 0:00:48.689,0:00:51.669 you sat down, don't worry. You can pick them up on the way out. They're 0:00:51.670,0:00:54.300 the same handouts. They'll still be there. 0:00:54.299,0:00:55.939 So 0:00:55.939,0:00:59.519 just a quick introduction. That's what the first four handouts actually give you. 0:00:59.520,0:01:02.680 They give you a little bit of an introduction to the class, what we're gonna cover, some 0:01:02.679,0:01:05.629 logistics for the class and some other stuff. I'm gonna go over all 0:01:05.629,0:01:10.379 that today so we can sort of get a good idea for where we're at, okay? So just a quick show 0:01:10.379,0:01:13.920 of hands before we get into a bunch of things in the class. 0:01:13.920,0:01:17.820 This is kind of an intro-programming course; well, it is. I shouldn't say it's kind of an 0:01:17.819,0:01:19.978 intro-programming course. It is an intro-programming course. And 0:01:19.978,0:01:23.739 it's always good to get an idea as to how much familiarity you may have 0:01:23.739,0:01:25.058 beforehand, okay? 0:01:25.058,0:01:27.239 So just quick show of hands. 0:01:27.239,0:01:31.329 How many people can recognize a computer that's on? 0:01:31.329,0:01:35.829 Good, good. That's the prerequisite for this class. So if you're worried about 0:01:35.829,0:01:38.450 how much previous experience you've had 0:01:38.450,0:01:42.420 or your friend who, like, worked their way through high school by programming for Google or 0:01:42.420,0:01:43.159 whatever, 0:01:43.159,0:01:46.460 don't worry about it because all you need to know in here is basically 0:01:46.459,0:01:50.048 either how to turn a computer on or to recognize a computer that's on if you 0:01:50.049,0:01:53.090 were to walk up to it and it were already to be on, all right? 0:01:53.090,0:01:56.728 So but a little bit more seriously, how many people have actually used a computer 0:01:56.728,0:01:59.049 for anything? 0:01:59.049,0:02:02.420 All right. I would expect most of you. So now, we begin to bump it up 0:02:02.420,0:02:05.409 a notch. How many people have used it for word processing? 0:02:05.409,0:02:09.568 Okay. Most folks. How many people have done web browsing? 0:02:09.568,0:02:13.318 Yeah, I won't ask you what you look at, all right? It's just I don't wanna know. 0:02:13.318,0:02:17.198 How many people have actually created a web page? Okay. 0:02:17.199,0:02:22.629 Fair number. How many people have done any kind of programming before? 0:02:22.628,0:02:23.709 Fair number. 0:02:23.709,0:02:28.618 All right. How about how many folks have done actually programmed in Java before? 0:02:28.618,0:02:34.188 All right. A few folks. How about another language, C, C++, 0:02:34.188,0:02:35.049 BASIC, 0:02:35.049,0:02:37.680 anyone program in BASIC? Yeah, 0:02:37.680,0:02:41.159 oh, I love - that was the first language I learned, and it was kind of 0:02:41.158,0:02:44.900 like the warm and fuzzy, and I felt good. There was actually people who argued that if you learn 0:02:44.900,0:02:48.489 BASIC as your first language, you're brain damaged, then you're just beyond help. But if 0:02:48.489,0:02:49.150 that's the case, we're all 0:02:49.150,0:02:52.120 in the boat together because I'm probably brain damaged as well. The truth is I 0:02:52.120,0:02:54.618 probably am, but that's a whole different story. 0:02:54.618,0:02:57.929 All right. So one thing you should know kind of up front is actually this course 0:02:57.929,0:03:01.489 is gonna be provided eventually somewhere down the line as part of 0:03:01.489,0:03:03.789 Stanford School of Engineering Free Course Initiative, 0:03:03.789,0:03:07.120 which means not only are we recording this course to broadcast to a bunch 0:03:07.120,0:03:09.990 of companies and industry who are watching this course, but we're eventually 0:03:09.990,0:03:12.099 gonna provide it free to the world. 0:03:12.098,0:03:13.979 So how does that impact your life? 0:03:13.979,0:03:16.888 And on the average day, it doesn't at all. 0:03:16.889,0:03:19.749 The only way it does impact your life is just so you should know, the lawyers told me to 0:03:19.748,0:03:20.840 tell you that your 0:03:20.840,0:03:24.250 voice, should you ask a question, may actually be recorded as part of the 0:03:24.250,0:03:25.308 video. 0:03:25.308,0:03:29.079 As a result, your voice may end up going out to thousands of people or millions 0:03:29.079,0:03:30.550 of people in the world. 0:03:30.550,0:03:33.020 If you have an issue with that, come talk to me. 0:03:33.020,0:03:37.000 If you don't, everything is just fine, all right? Don't worry. We're not gonna put your picture up 0:03:37.000,0:03:39.748 or anything like that. You might wanna be on the video, like, "Hey, 0:03:39.748,0:03:40.609 ma, I'm on 0:03:40.609,0:03:43.889 TV." We decided that we're just gonna not show anyone actually on the video, 0:03:43.889,0:03:46.129 but your voice may actually get recorded, okay? 0:03:46.128,0:03:49.828 Now, along those lines, you may also notice there are some microphones in the room. 0:03:49.829,0:03:52.709 So when you wanna ask a question, please make sure to use the microphone 0:03:52.709,0:03:56.209 because that's not only good for people in here to be able to hear your question, 0:03:56.209,0:03:59.579 it's also good for all the folks that this is getting broadcast to because not 0:03:59.579,0:04:02.289 only are we gonna broadcast to the world, but there's actually some folks who are sort 0:04:02.288,0:04:05.578 of watching this live now in various companies in Silicon Valley. 0:04:05.579,0:04:08.389 So it's real important that you actually use the microphone, so just remember that. And 0:04:08.389,0:04:11.130 every once in a while, I might get on your case and be, like, "Please use the microphone." 0:04:11.129,0:04:14.599 I'm not trying to be argumentative or anything. I just wanna make sure we 0:04:14.599,0:04:16.488 pick up all the audio, all 0:04:16.488,0:04:19.560 right? So with that said, a little bit of an introduction. That's kind of a way of background. 0:04:19.560,0:04:22.550 I didn't give you any sort of introduction. So just to introduce myself, my name's 0:04:22.550,0:04:25.379 Mehran Sahami. I'm the professor for the class. 0:04:25.379,0:04:28.228 Don't call my Professor Sahami, way too formal. 0:04:28.228,0:04:31.899 Don't call me Mr. Sahami. That, I think of my dad. 0:04:31.899,0:04:35.098 And don't call me Mrs. Sahami, or we're gonna have issues, all right? 0:04:35.098,0:04:36.219 So just call me 0:04:36.220,0:04:40.520 Mehran. We'll get along. It's just fine, all right? It's to keep things a little bit more 0:04:40.519,0:04:43.490 informal, but that way it's a little bit easier to discuss stuff as you go along. 0:04:43.490,0:04:46.949 There is also a head TA for the class, Ben Newman, who's standing up there. Get to know 0:04:46.949,0:04:47.980 Ben. 0:04:47.980,0:04:51.700 He has all the real power in this class. I'm just kind of the monkey that gets up here and 0:04:51.699,0:04:54.159 gives the lectures. But Ben really is the one who's got all the 0:04:54.160,0:04:55.189 power. 0:04:55.189,0:04:57.829 Along with the head TA for the class, we have a large section leading staff. So 0:04:57.829,0:05:03.519 the section leaders here, could you stand up if you're here? They're kind 0:05:03.519,0:05:06.408 of all over the place, some over here, some over there, and some over there. As 0:05:06.408,0:05:09.889 you can see, there's a pretty large number of folks. And this isn't even all of them. 0:05:09.889,0:05:12.759 We sort of have more - we just can't stuff them all into the room - 0:05:12.759,0:05:16.800 who are section leaders for the class, and these folks are all here to make sure 0:05:16.800,0:05:20.189 that everyone in this class has as good an experience as possible when 0:05:20.189,0:05:22.889 we're sort of going through the class. And the best way to reach all of us is 0:05:22.889,0:05:26.300 email. So on Handout No. 1, you get my email and Ben's email. 0:05:26.300,0:05:30.090 We'll tell you how to sign up for section. That's how you'll meet your section leader and get your section 0:05:30.089,0:05:33.810 leader's email. That will all be coming soon. But email really is kind of a happy form of 0:05:33.810,0:05:35.250 communication to 0:05:35.250,0:05:37.059 get a hold of us, okay? 0:05:37.059,0:05:40.460 So with that said, I wanna tell you a little bit about this class and kind of 0:05:40.459,0:05:43.478 what we're gonna do in here and what you should expect and make sure that 0:05:43.478,0:05:43.930 0:05:43.930,0:05:47.519 you don't feel scared off by this class, okay? Because it really is meant to sort of be an 0:05:47.519,0:05:48.750 interesting time. 0:05:48.750,0:05:52.579 But one question that comes up is why is this class called Programming 0:05:52.579,0:05:53.219 Methodology, 0:05:53.220,0:05:56.259 right? Why don't we just call this class, like, 0:05:56.259,0:05:57.679 Programming with Java? 0:05:57.678,0:06:00.768 And the real reason for that is that programming methodology is about good 0:06:00.769,0:06:03.759 software engineering principles. It's about something that's much larger than 0:06:03.759,0:06:07.139 just programming. So some people, like, they'll go and get a book somewhere and they'll 0:06:07.139,0:06:09.859 think they learned how to program by just reading the book. And they're, 0:06:09.858,0:06:12.688 like, "Oh, I know how to program. Isn't that great?" And it's, like, 0:06:12.689,0:06:15.729 yeah, you might know the mechanics of the language, but the mechanics of the 0:06:15.728,0:06:18.829 language are nothing compared to understanding the software engineering 0:06:18.829,0:06:19.658 principles 0:06:19.658,0:06:23.060 that go into actually developing a software system. And that's what you're gonna 0:06:23.060,0:06:26.189 learn about in this class. You're gonna learn a lot of those principles. But in order 0:06:26.189,0:06:27.010 to be able to use 0:06:27.009,0:06:30.620 those principles and apply them, you also need to have the language to program in, 0:06:30.620,0:06:33.850 and that language that we're gonna use in this class is Java. So the way I like to 0:06:33.850,0:06:36.930 think about it and the way I tell a lot of people is writing a good program or 0:06:36.930,0:06:40.310 learning how to program is like learning to be a good 0:06:40.310,0:06:41.649 essay writer. And you're, like, "Oh, but part 0:06:41.649,0:06:45.519 of the reason I'm taking this class, Mehran, is that I don't like writing essays." That's fine. 0:06:45.519,0:06:49.028 It's okay. Trust me. I didn't like writing essays either. But 0:06:49.028,0:06:52.389 the whole point is that when you write an essay, it's not a formulated kind of 0:06:52.389,0:06:55.538 thing. You're, like, "Well, what about five-paragraph essays?" Yeah, just block that from 0:06:55.538,0:06:59.818 your mind. That was a bad time, right? That was just, like, '70s education at work. 0:06:59.819,0:07:02.968 It's not a formulated kind of thing. There's an art to writing an essay, 0:07:02.968,0:07:05.959 right? In order to write an essay, you need to know a language. You need to know English or German or 0:07:05.959,0:07:08.079 Hindi or whatever language you wanna use, 0:07:08.079,0:07:10.659 but then you use that language to write an essay. 0:07:10.660,0:07:13.710 Just knowing the language doesn't make you a good essay writer though. Being 0:07:13.709,0:07:16.498 a good essay writer makes you a good essay writer. 0:07:16.499,0:07:19.709 So that's the same difference in programming and software engineering. Knowing the 0:07:19.709,0:07:23.228 language, in order to be a good programmer, like a good essayist, 0:07:23.228,0:07:26.829 you need to know a language to write your programs in, whether that be Java or C or 0:07:26.829,0:07:29.609 C++ or whatever. Here we're gonna use Java. 0:07:29.610,0:07:33.229 But just knowing the language doesn't make you a good software engineer and 0:07:33.228,0:07:36.478 doesn't make you understand what the principles are of writing good software, 0:07:36.478,0:07:39.558 which is what you're also gonna get in this class in addition to the language, and that's kind of 0:07:39.559,0:07:41.719 a key thing to stress. 0:07:41.718,0:07:44.759 So if you're sort of worried, if you were kind of looking around and you saw a bunch of people raising 0:07:44.759,0:07:46.160 their hands when I asked, "Do 0:07:46.160,0:07:49.080 you have any previous programming experience?" and some folks raised their 0:07:49.079,0:07:53.079 hands, and you got a little worried and you're like, "Oh, am I gonna be in some sense at 0:07:53.079,0:07:56.659 a disadvantage because I haven't done any programming before?" The answer, plain and 0:07:56.660,0:07:58.409 simple, is no, okay? You're 0:07:58.408,0:08:00.819 gonna learn everything you need to learn from the first principle because as a 0:08:00.819,0:08:01.900 matter of fact, 0:08:01.899,0:08:05.579 in some cases you might be in slightly better shape. That's not necessarily to say 0:08:05.579,0:08:07.680 that that's the way it will be. But 0:08:07.680,0:08:11.228 how many people are Star Wars fans? Just wondering. Anyone? I'm 0:08:11.228,0:08:14.308 talking about the old-school, original, like, three movies. Those were so good, and 0:08:14.309,0:08:17.949 we're not - no George R. Binks here, all right? 0:08:17.949,0:08:22.090 So if you remember - and sort of I'm a big Star Wars fan, and that's just a whole 0:08:22.089,0:08:22.919 separate point. 0:08:22.920,0:08:26.460 But in the second movie, Yoda actually said something which I thought was quite 0:08:26.459,0:08:27.979 profound, which is he says 0:08:27.980,0:08:31.030 sometimes you have to unlearn what you have learned. 0:08:31.029,0:08:34.448 And one of the things we actually find is that some people who are self-taught programmers, 0:08:34.450,0:08:36.909 some of them are just fine, and some of them are very good. 0:08:36.909,0:08:39.828 But some of them have picked up some really bad habits along the way, and it's 0:08:39.830,0:08:41.460 like being a bad essay writer. 0:08:41.460,0:08:45.070 And to go from being a bad essay writer to a good essay writer, in some cases, can 0:08:45.070,0:08:46.280 actually be harder 0:08:46.279,0:08:49.350 than from not being an essay writer to being a good essay writer because you 0:08:49.350,0:08:51.339 have to unlearn the bad habits. 0:08:51.339,0:08:54.450 So if you're worried about, "Oh, I've had no previous experience," 0:08:54.450,0:08:57.460 don't worry. You're okay, blank slate, you're just fine. And now if you're thinking, 0:08:57.460,0:09:00.940 "Oh, I have some previous experience. Do I have bad habits?" Don't worry. You'll be 0:09:00.940,0:09:04.880 fine, too, okay? So it's all gonna work out. 0:09:04.879,0:09:07.720 So the next question that kind of comes up - hopefully that helps put some of your fears 0:09:07.720,0:09:08.300 aside. 0:09:08.299,0:09:12.120 Another one of the things is that we really strive to make everyone successful in this 0:09:12.120,0:09:13.669 class, okay? At some other schools, 0:09:13.669,0:09:16.698 people wanna do computer science or they wanna do an 0:09:16.698,0:09:19.438 engineering major or whatever. And you come into the first day of class, and they say, 0:09:19.438,0:09:23.088 "Oh, only one third of you are actually gonna make it through this program. And 0:09:23.089,0:09:25.800 look to the person to your left and look to the person to your right, and only one 0:09:25.799,0:09:28.370 of you will make it through." And you're, like, "Oh, 0:09:28.370,0:09:29.948 man, that's real nice." 0:09:29.948,0:09:33.438 It's not like that here. As a matter of fact, we want all of you to be extremely 0:09:33.438,0:09:37.248 successful in this class, which is why we have a huge course staff, which is why over years 0:09:37.249,0:09:40.379 and years we've refined how we do a lot of the teaching in this class 0:09:40.379,0:09:43.730 to make sure you have the best possible experience and to make sure that everyone 0:09:43.730,0:09:44.990 gets through. 0:09:44.990,0:09:48.779 And the important thing about that is that you're not competing against anyone 0:09:48.779,0:09:51.339 except yourself in this class. It's not like we're gonna have a curve and 0:09:51.340,0:09:54.350 we're gonna say, "Oh, we have a certain number of "F"s and a certain number of 0:09:54.350,0:09:56.129 "D"s and a certain number of "C"s." 0:09:56.129,0:09:59.120 All we really have going into it is an expectation that when you get out of 0:09:59.120,0:10:01.500 here, there's a set of stuff we want you to know. 0:10:01.500,0:10:03.220 And if you know that stuff well, 0:10:03.220,0:10:04.170 you get an "A." 0:10:04.169,0:10:06.679 And if everyone knows that stuff well, 0:10:06.679,0:10:07.799 everyone gets an "A." 0:10:07.799,0:10:11.019 And I got no problems with that. Registrar might have a problem with that, but that's okay. 0:10:11.019,0:10:12.720 You don't need to worry about that. 0:10:12.720,0:10:14.990 So you don't need to think about, oh, 0:10:14.990,0:10:18.379 is someone else doing better than you or whatever. And we'll talk about 0:10:18.379,0:10:21.340 issues of collaboration in just a little bit. All you need to think about is 0:10:21.340,0:10:24.670 learning the stuff yourself as well as you possibly can, and you'll be just fine 0:10:24.669,0:10:26.729 and you'll get a good grade, okay? 0:10:26.730,0:10:28.909 So that's really all we ask, 0:10:28.909,0:10:29.909 which is not 0:10:29.909,0:10:33.379 a trivial amount, right? It requires you to really understand the material. 0:10:33.379,0:10:36.340 So another question that comes up is are you in the right place, right? This 0:10:36.340,0:10:39.070 isn't the only introductory programming class at Stanford. And so I wanna spend a 0:10:39.070,0:10:41.890 little bit of time making sure you actually are in the right place 0:10:41.889,0:10:44.519 by going over some of the different options. So right 0:10:44.519,0:10:47.399 now, as you know, you're in CS106A. 0:10:47.399,0:10:50.480 And CS106A, we're sort of happy over here, 0:10:50.480,0:10:51.050 right? As 0:10:51.049,0:10:54.870 a matter of fact, we're not only happy, we're happy and we're also a little bit loopy, 0:10:54.870,0:10:56.919 right? 0:10:56.919,0:11:00.039 There is no previous programming experience required, as I mentioned, right? All you 0:11:00.039,0:11:04.230 need to know is basically if you can get to a computer and know how to 0:11:04.230,0:11:06.710 figure out that it's on, you're in good shape. 0:11:06.710,0:11:10.850 But what 106A does is it's a real rigorous class. You learn programming in 0:11:10.850,0:11:14.330 here, and you learn it in a way that makes you ready to be an engineer if you so 0:11:14.330,0:11:15.829 choose to be an engineer. 0:11:15.828,0:11:18.218 That's not to say you're all gonna be engineers. I would love for all of you to 0:11:18.219,0:11:21.309 be computer science majors, but statistics in the past show only about 0:11:21.308,0:11:24.278 6 percent of you will be computer science majors. That's not because we 0:11:24.278,0:11:25.958 turn anyone off to computer science; 0:11:25.958,0:11:29.169 it's because we make programming accessible to so many people 0:11:29.169,0:11:32.099 that you don't have to be a computer science or a Double E or even an 0:11:32.100,0:11:34.960 engineering major to do extremely well in the class. And we actually have sort 0:11:34.960,0:11:38.730 of a significant percentage of the entire campus undergraduate student body 0:11:38.730,0:11:42.360 at Stanford actually goes through this class and does well, okay? 0:11:42.360,0:11:45.778 So don't worry if you're, like, "Oh, but I'm not really a CS person." I hope 0:11:45.778,0:11:49.409 we'll turn you into one by the end of the class. No, it's okay. But 0:11:49.409,0:11:53.360 you'll be prepared if that's what you wanna do. So this leads into a whole 0:11:53.360,0:11:54.449 engineering sequence 0:11:54.448,0:11:58.799 that can go on to other engineering majors or the computer science majors. 0:11:58.799,0:12:02.019 If you're, like, "Huh, I'm not sure if that's really what I wanna do. As a matter of fact, 0:12:02.019,0:12:04.600 I'm so sure that's not what I wanna do, 0:12:04.600,0:12:07.300 I only wanna get the general educational requirement out of the way, and 0:12:07.299,0:12:11.049 I'm positive there is nothing else I wanna do. Really, no matter how much I like 0:12:11.049,0:12:15.089 it, like, there is no way you're gonna drag me into anything that would involve 0:12:15.090,0:12:17.040 anything remotely techie." 0:12:17.039,0:12:21.879 They're the class CS105. And this is happy, 0:12:21.879,0:12:22.489 yeah, 0:12:22.489,0:12:25.990 this is kind of, oh, we're happy in our little happy world. 0:12:25.990,0:12:30.500 And I don't wanna say it's holding hands and singing, "Kumbaya," because that's not what it is. It's a real 0:12:30.500,0:12:34.120 class. 0:12:34.120,0:12:38.060 But it's meant to be a general educational requirement, right? It 0:12:38.059,0:12:41.989 doesn't lead into the 106s. It's meant to be its own self-contained class. 0:12:41.990,0:12:45.459 You do some Java script in there. You do a little bit of what computers are about. 0:12:45.458,0:12:48.539 Computers in society is a good time. We all hold hands. We're all happy. I don't 0:12:48.539,0:12:50.839 teach the class, so I don't actually hold hands. 0:12:50.840,0:12:54.430 But it's a fun time, okay? It just doesn't lead to anything else. So think of this as 0:12:54.429,0:12:57.959 kind of a terminal class, right? So it's sort of like, well, we'll hook you up to the 0:12:57.960,0:12:59.570 IV drip. And 0:12:59.570,0:13:02.390 you're, like, "Well, 106A, you told me I don't need any previous background. 0:13:02.389,0:13:03.100 Well, 0:13:03.100,0:13:07.589 hey, Mehran, I got lots of background. I got so much background, it hurts. I got AP 0:13:07.589,0:13:09.749 background, I got working through school doing software engineering 0:13:09.749,0:13:10.680 background. 0:13:10.679,0:13:12.759 I'm not sure I should be here." 0:13:12.759,0:13:16.710 That could be the case. We have another class called CS106X, and as 0:13:16.710,0:13:21.560 the "X" kind of implies, it's sort of the extreme games version of the class. No, it 0:13:21.559,0:13:23.888 stands for accelerated, right, because 0:13:23.889,0:13:28.580 "A" was already taken, so we had to come up with something else. 0:13:28.580,0:13:33.250 So the way CS106X works is it really is a very fast-paced class. It's 0:13:33.250,0:13:35.649 meant for people who've got previous AP exam 0:13:35.649,0:13:37.659 credit, like, got a 4 or 5 on the AP, 0:13:37.659,0:13:41.110 or have had significant and prior programming experience before. 0:13:41.110,0:13:44.460 If you're not sure which one of these classes is for you, you can come talk to me 0:13:44.460,0:13:47.530 afterwards, or I'd also encourage you, you could go to pick up the syllabus for 0:13:47.529,0:13:50.399 CS106X and compare it to CS106A. 0:13:50.399,0:13:55.458 This class is all in C++. And if you're thinking, "Hey, Mehran, I'm doing 106A. I wanna learn 0:13:55.458,0:13:59.278 Java and C++," don't worry. You'll eventually, if you so choose, take a 0:13:59.278,0:14:03.048 class called CS106B, which is where this class sort of leads to, which 0:14:03.048,0:14:03.909 is 0:14:03.909,0:14:07.199 C++ and all of the other stuff you would have learned in this accelerated 0:14:07.200,0:14:08.060 class, 0:14:08.059,0:14:11.459 okay? So you still certainly have that course path. So don't let anyone make you think - 0:14:11.460,0:14:14.850 I know a lot of times, and especially for Stanford students, you come in here and you're, like, "Well, 0:14:14.850,0:14:17.800 every class I took in high school was like an honors or an AP class, 0:14:17.799,0:14:20.969 or if it wasn't an honors or an AP class, like, I had to tie half my brain 0:14:20.970,0:14:23.460 before my head because I'm just that hardcore." 0:14:23.460,0:14:25.560 And so everyone just wants to, like, do 0:14:25.559,0:14:29.659 the most hardcore thing they can, right? And what I'm here to tell you is that 0:14:29.659,0:14:32.350 you shouldn't necessarily think about it that way. You should think about it as where 0:14:32.350,0:14:34.649 you feel most comfortable. 0:14:34.649,0:14:38.459 Some number of years ago, let's just say greater than 10, maybe 15, I was 0:14:38.460,0:14:40.530 sitting where you're sitting right now, 0:14:40.529,0:14:40.809 literally. 0:14:40.809,0:14:44.859 I was in CS106A in Terman Auditorium as a freshman, 0:14:44.860,0:14:49.279 okay? It was perfectly fine. It worked out. I went to grad school, did the faculty 0:14:49.279,0:14:53.549 thing. It's just fine. It will open your doors to CS. You're not at any kind of 0:14:53.549,0:14:56.539 disadvantage by starting here. So know where you've been, literally. Like, that seat 0:14:56.539,0:14:58.439 right there was where I was 0:14:58.440,0:15:00.280 most of the time. 0:15:00.279,0:15:03.259 So just something to keep in mind in terms of the different options that are actually 0:15:03.259,0:15:04.319 available to you. 0:15:04.320,0:15:07.670 Now, with that said, let's just assume for the rest of this lecture that this is the 0:15:07.669,0:15:11.029 right place for you. And if it's not, well, afterwards we can kind of talk about it, 0:15:11.029,0:15:13.970 or if you really are convinced now that it's not the right place, you can feel free and try 0:15:13.970,0:15:14.980 to 0:15:14.980,0:15:17.649 scramble over 20 of your classmates and actually leave the room, which is 0:15:17.649,0:15:20.069 probably impossible. All right. 0:15:20.070,0:15:23.150 So a few other things you should know, some mechanics. So Handout No. 1, should 0:15:23.149,0:15:25.269 you wanna follow along at home, 0:15:25.269,0:15:27.429 is the class web page. 0:15:27.429,0:15:32.039 And so all the stuff that we think of as course materials, including online 0:15:32.039,0:15:34.990 copies of the handouts, things that you'll need to do for the assignments, announcements 0:15:34.990,0:15:36.220 related to the class 0:15:36.220,0:15:37.990 are all on the class web page, 0:15:37.990,0:15:44.990 which is 0:15:46.750,0:15:48.840 www.stanford.edu/class/cs106a. 0:15:48.840,0:15:52.230 And because that's just kind of a whole bunch to remember, we make your life easy 0:15:52.230,0:15:56.950 and so there is an equivalent form of the URL, which is just 0:15:56.950,0:16:00.860 cs106a.stanford.edu, which is the easy thing to remember. You put that in, it'll take 0:16:00.860,0:16:03.039 you to the class web page, okay? 0:16:03.039,0:16:05.730 And you should check that regularly because all the 0:16:05.730,0:16:09.058 announcements and handouts - we'll give out hard copies of all the handouts in class, but 0:16:09.058,0:16:11.688 should you happen to miss class for whatever reason, you wanna go print 0:16:11.688,0:16:14.808 whatever copies of the handouts we're actually giving out, you can find them all on 0:16:14.808,0:16:16.439 the web page, okay? 0:16:16.440,0:16:20.440 Now, there's this funky thing about units. So you may have noticed that this class is for three 0:16:20.440,0:16:23.800 to five units, and that kind of brings up the natural question, "Should I take it for three 0:16:23.799,0:16:25.329 or five units?" 0:16:25.330,0:16:29.300 If you're an undergrad, you take it for five units, end of story. That's life in the city. 0:16:29.299,0:16:30.609 Congratulations. Five units. 0:16:30.610,0:16:34.279 If you're a graduate student, you can have the option of taking it for three 0:16:34.279,0:16:38.129 units if you want, if you're gonna run into some unit cap. 0:16:38.129,0:16:41.360 It doesn't change the amount of work you have to do. 0:16:41.360,0:16:42.818 Welcome to graduate school. 0:16:42.818,0:16:44.509 Same work, fewer units. 0:16:44.509,0:16:47.639 So that's just the way life is. If you have a unit cap and you're a grad student, in 0:16:47.639,0:16:50.919 three units you can take it if you want. You can take it for five if you want as well. If you're an 0:16:50.919,0:16:53.240 undergrad, you take it for five, all right? 0:16:53.240,0:16:55.938 So why is it five units? And you might think, "Hey, 0:16:55.938,0:16:59.428 this class only meets three times a week. How come it's five units?" Well, it actually 0:16:59.428,0:17:02.578 has a fourth meeting every week, which is your section, and that's something you 0:17:02.578,0:17:04.279 should sign up for. 0:17:04.279,0:17:06.509 So how you actually sign up for your section 0:17:06.509,0:17:10.618 is sections are at a bunch of different times. You don't sign up for them in 0:17:10.618,0:17:13.118 Axess, even though they're all kind of listed in the time schedule. That's not where 0:17:13.118,0:17:16.068 you sign up for them. In Axess, you just sign up for the class. 0:17:16.068,0:17:20.898 How you sign up for a section is you go to a website, cs198.stanford.edu/section 0:17:20.900,0:17:22.000 0:17:22.000,0:17:24.920 0:17:24.920,0:17:30.519 and this will give us a list of preferences for 0:17:30.519,0:17:33.730 section times that you wanna sign up for, and there's some matching process that goes on. 0:17:33.730,0:17:37.450 It takes all your preferences into consideration with the whole system, and 0:17:37.450,0:17:39.190 eventually you get an email 0:17:39.190,0:17:42.460 by sometime early next week that tells you what section you're in. And section's 50 0:17:42.460,0:17:45.659 minutes, once a week. It's required to go to. It's actually gonna be part of your class 0:17:45.659,0:17:48.640 participation grade, which we'll talk about in just a bit, okay? 0:17:48.640,0:17:52.920 When do these sign-ups happen? They happen between 5:00 p.m. this Thursday 0:17:52.920,0:17:56.130 is when they go up. So if you try to go there now, you can't sign up. Remember 5:00 0:17:56.130,0:17:59.150 p.m. Thursday. So they're up, and then they're down 0:17:59.150,0:18:03.980 at 5:00 p.m. on Sunday, okay? So 0:18:03.980,0:18:06.769 make sure you sign up probably this weekend. If you're planning on being out of 0:18:06.769,0:18:09.990 town this weekend, you wanna sign up before you go. Sign up early, but don't 0:18:09.990,0:18:13.529 sign up often because you only need one section, okay? 0:18:13.529,0:18:17.119 If you're an SCPD student - every once in a while you'll hear me refer to SCPD 0:18:17.119,0:18:20.119 students. That stands for Stanford Center for Professional Development. 0:18:20.119,0:18:23.109 They are the folks in industry who actually take this class 0:18:23.109,0:18:26.389 via broadcast. If you're an SCPD student, you're automatically enrolled for a section, 0:18:26.390,0:18:30.259 so you don't actually need to do this, and your section will meet at - so for SCPD 0:18:30.259,0:18:33.929 - and if you're wondering what an SCPD student is, you're not one, okay? 0:18:33.929,0:18:40.259 So SCPD section meets Friday from 1:15 to 2:05. It meets 0:18:40.259,0:18:44.089 live, if you wanna go there live, in Skilling Auditorium. But if you're 0:18:44.089,0:18:48.269 watching it remotely, it meets on Channel E2. I 0:18:48.269,0:18:52.609 know it seems weird to say it meets on channel - what does that mean? It meets on 0:18:52.609,0:18:56.869 Channel E2, okay? That is grammatically the correct way of saying it. 0:18:56.869,0:18:57.619 All right. 0:18:57.619,0:19:01.529 So there's a little bit more administrative stuff. Now, 0:19:01.529,0:19:05.049 textbooks, right? Textbooks, there's nothing quite like the extortion that is 0:19:05.049,0:19:07.039 textbooks. So there are 0:19:07.039,0:19:09.539 two textbooks that are required for this class. Well, one's a course reader and 0:19:09.539,0:19:12.789 one's a textbook. The course reader is called, Karel the Robot Learns Java. You 0:19:12.789,0:19:16.079 can pick it up at the bookstore. It's relatively cheap. It was actually written by Eric 0:19:16.079,0:19:19.799 Roberts here. And surprisingly enough, the textbook for the class was also written by 0:19:19.799,0:19:23.180 Eric Roberts, The Art and Science of Java, which is available now in your local 0:19:23.180,0:19:24.630 bookstore, 0:19:24.630,0:19:27.710 including the bookstore on campus, so you can go and pick up a copy of this. 0:19:27.710,0:19:30.690 So both these things you actually wanna have because they're required for the 0:19:30.690,0:19:33.759 class. We'll go through all of them. We'll go through basically everything except 0:19:33.759,0:19:35.729 the last chapter of this book. So you 0:19:35.729,0:19:38.359 sort of get your money's worth. We're just gonna do it a little bit out of 0:19:38.358,0:19:40.689 order, but we'll go through the whole thing, 0:19:40.690,0:19:42.809 okay? So email, 0:19:42.809,0:19:45.869 how many of you have email accounts? All 0:19:45.869,0:19:48.689 right. I will ask the reverse question because I think at this point, some people just don't 0:19:48.690,0:19:49.799 wanna put up their hands. 0:19:49.799,0:19:53.230 How many people don't have email accounts? 0:19:53.230,0:19:56.240 Odd how that is not the complement of the folks who had their hands up 0:19:56.240,0:19:57.220 previously. 0:19:57.220,0:20:00.910 Email's required for this class. Chances are, by being at Stanford, you've already gotten an 0:20:00.910,0:20:03.769 email account through your SUNet ID, but if you don't have an email account, get 0:20:03.769,0:20:06.210 an email account and that's how you'll stay in contact with us. That's how we'll stay in 0:20:06.210,0:20:09.059 contact with you, except we'll also meet with you live in person, 0:20:09.059,0:20:12.109 but email is kind of the general method for communication. As a matter of fact, for your 0:20:12.109,0:20:15.178 first assignment, and part of your first assignment is to send us an email, 0:20:15.179,0:20:16.900 just because we love you 0:20:16.900,0:20:18.740 and we don't get enough email as it is. 0:20:18.740,0:20:21.470 So you need to have an email account to be able to do that. So if you have not 0:20:21.470,0:20:24.250 already, you can kind of get ahead of the game and go set up your email 0:20:24.250,0:20:26.720 account. Now, don't worry. You'll get the first assignment next time. So you still get, like, 0:20:26.720,0:20:30.350 two days of breathing space before your assignment goes out, okay? 0:20:30.349,0:20:33.149 There is also gonna be lots of handouts in the class. They'll be either given out in class, 0:20:33.150,0:20:36.970 well, they will be given out in class, but we'll also post them online in case you miss them. 0:20:36.970,0:20:40.558 And how much real work do you do in this class? That's always kind of an interesting 0:20:40.558,0:20:40.898 question. 0:20:40.898,0:20:43.379 So let's talk a little bit about assignments 0:20:43.380,0:20:46.620 and a little bit of other logistical things. 0:20:46.619,0:20:49.679 So assignments, 0:20:49.680,0:20:54.430 we'll just call them the dreaded assigns. There are seven programming assignments. 0:20:54.430,0:20:57.120 And if you look at the syllabus Handout No. 2, it tells you when all of them 0:20:57.119,0:21:01.149 are due all the way through by day, so you can plan out your whole quarter. It's 0:21:01.150,0:21:03.670 just that much fun, okay? 0:21:03.670,0:21:07.269 And these seven programming assignments are weighted slightly more toward the 0:21:07.269,0:21:09.930 last assignments because the assignments will tend to get more complicated. That doesn't 0:21:09.930,0:21:11.990 necessarily mean there'll be more programming; 0:21:11.990,0:21:14.589 it just means conceptually, they'll become more complicated, 0:21:14.589,0:21:17.789 so we tend to weigh them more toward the end of the class. So the later assignments count 0:21:17.789,0:21:19.879 more than the early assignments. 0:21:19.880,0:21:25.150 How you're gonna be actually doing your programming is using a little tool called Eclipse. 0:21:25.150,0:21:28.480 And Eclipse thankfully is free, so you don't have to pay for it. As a matter of 0:21:28.480,0:21:31.450 fact, you can download it from the CS106A website. And if you're wondering 0:21:31.450,0:21:34.600 how you do that, don't worry. We'll give you a handout next class that explains 0:21:34.599,0:21:36.699 to you the whole grueling process 0:21:36.700,0:21:38.509 of downloading and installing Eclipse. 0:21:38.509,0:21:43.230 And you can use this either on the Mac or the PC. So if you have your own 0:21:43.230,0:21:46.480 computer, you can certainly work on this yourself. You just download it to your 0:21:46.480,0:21:49.110 own machine. We'll explain the whole process in a handout. 0:21:49.109,0:21:52.649 If you don't have your own computer, the public computer clusters on campus 0:21:52.650,0:21:55.710 will have Eclipse installed on them, and so you can use Eclipse there. So you're 0:21:55.710,0:21:58.730 sort of happy to go either way, okay? Now, 0:21:58.730,0:22:01.429 the important thing, remember I mentioned that whole notion of software 0:22:01.429,0:22:03.780 engineering in the class, and that's something we take really seriously, so 0:22:03.779,0:22:06.349 seriously as a matter of fact that when you turn in your assignments, one thing we could do is we could take 0:22:06.349,0:22:07.269 your assignments 0:22:07.269,0:22:11.348 and we could just kind of look at it and go, "Yeah, interesting, 'B.' Here you go. 0:22:11.348,0:22:12.589 Thanks for playing." 0:22:12.589,0:22:16.649 And you don't learn a whole lot from them. So in order to actually learn a lot from 0:22:16.650,0:22:19.280 your assignments, we could take your assignment and write a whole bunch of 0:22:19.279,0:22:22.678 comments on it and hand it back to you. Even that's kind of not enough. 0:22:22.679,0:22:26.528 What really is a little bit more that makes it more fun is every week after 0:22:26.528,0:22:29.769 you turn in your assignment and your section leader looks it over and grades it, 0:22:29.769,0:22:32.940 you'll actually meet with your section leader for about 10 to 15 minutes 0:22:32.940,0:22:35.278 every week or every time an assignment is due 0:22:35.278,0:22:38.038 to actually go over in something referred to as interactive grading. And it's 0:22:38.038,0:22:41.450 a chance to sit there and talk with an actual human being about what's good in 0:22:41.450,0:22:44.739 your assignment, what are some of the things you need to work on, what are some of the 0:22:44.739,0:22:47.940 software engineering principles you need to develop. And that way, you can really 0:22:47.940,0:22:52.499 sort of get more detailed information and be able to ask questions to develop 0:22:52.499,0:22:55.730 yourself as a programmer as well as get help if you need help, 0:22:55.730,0:22:59.759 okay? And that's in addition to going to section, going to class and all that stuff. So 0:22:59.759,0:23:02.869 it's another 15 minutes a week. You'll actually schedule that time with your 0:23:02.869,0:23:04.519 section leader on a regular basis 0:23:04.519,0:23:07.670 when you're gonna have interactive grading or just affectionately 0:23:07.670,0:23:11.560 referred to as IGs because at Stanford, everything's just short and we just can't 0:23:11.559,0:23:13.809 say, like, psychology; we have to say psyche. 0:23:13.809,0:23:17.470 So it's IG. Just remember that, all right? 0:23:17.470,0:23:20.450 And then how are these things graded? So the other thing we could do is I told you 0:23:20.450,0:23:22.600 we could just write "B" and hand it back to you. 0:23:22.599,0:23:25.309 But we found that that's not really great because people get all wrapped 0:23:25.309,0:23:27.339 around the axle about the grade. 0:23:27.339,0:23:30.988 And so for a while, we did numbers and we're, like, huh, why don't we give a number between 1 and 0:23:30.989,0:23:33.079 20? And so what happens there? 0:23:33.079,0:23:35.798 People get all wrapped around the axle about numbers. 0:23:35.798,0:23:39.099 So then we thought, huh, what was a happier time when we were in school? 0:23:39.099,0:23:42.730 I remember when we were in school, and we used to get back assignments and they 0:23:42.730,0:23:45.289 had, like, smiley faces on them. 0:23:45.289,0:23:48.659 Well, we can't do that because then it doesn't appear to be a rigorous Stanford 0:23:48.660,0:23:49.410 class. 0:23:49.410,0:23:52.440 So instead of the smiley face, 0:23:52.440,0:23:54.330 we come up with something else, 0:23:54.329,0:23:59.009 which looks surprisingly like this. It's kind of involved to actually draw, so I need to 0:23:59.009,0:24:04.980 erase the board to do it. Check. 0:24:04.980,0:24:07.490 That's kind of the beginning of our grading scale, okay? 0:24:07.490,0:24:11.529 And the way our grading scale works is we start off with a check in the middle, 0:24:11.529,0:24:14.899 which says this is a pretty solid program. It meets all the requirements 0:24:14.900,0:24:19.169 for the program. Maybe it's got a little problem here or there, but it's a check. 0:24:19.169,0:24:22.950 Then we have sort of two grades on the two sides of it: check plus and check 0:24:22.950,0:24:23.980 minus. 0:24:23.980,0:24:26.048 Check plus is, like, 0:24:26.048,0:24:27.168 solid. 0:24:27.169,0:24:31.520 You did a great job; you got everything right; things look good, a nice style in 0:24:31.519,0:24:35.619 your program, nice software engineering, and the program works flawlessly. 0:24:35.619,0:24:39.308 Good job. This is like total "A." 0:24:39.308,0:24:42.920 Check is kind of like, yeah, you're sort of there. It's kind of like "A" minus, "B" plus, 0:24:42.920,0:24:45.110 maybe on some occasions "B." 0:24:45.109,0:24:47.399 But it's kind of like it's pretty good work; you're in pretty good 0:24:47.400,0:24:48.710 shape here. 0:24:48.710,0:24:52.440 And so a lot of grades in this class ends up being check pluses and checks, and if that's 0:24:52.440,0:24:55.070 the case, you're perfectly fine grade-wise. 0:24:55.069,0:24:59.009 Check minus, as you can imagine, this is kind of thinking about "B," "B" minus. It's, 0:24:59.009,0:25:02.730 yeah, there are some slightly more significant problems with your program. 0:25:02.730,0:25:05.130 But that's not where it ends, right, because we wanna 0:25:05.130,0:25:09.090 be able to even shoot for in some sense bigger gustoes. There was a plus 0:25:09.089,0:25:10.480 and a minus. 0:25:10.480,0:25:12.450 So plus is like, 0:25:12.450,0:25:15.660 oh, nice job, kind of a hearty 0:25:15.660,0:25:18.150 pat on the back. If you get 0:25:18.150,0:25:20.940 pluses all the way through on all your assignments, you're in a pretty good 0:25:20.940,0:25:22.539 candidate to get an "A" plus. 0:25:22.539,0:25:26.569 And minus, like, just take good over here and replace it with bad, it's kind of like, 0:25:26.569,0:25:28.250 oh, 0:25:28.250,0:25:31.730 bad times, right, 0:25:31.730,0:25:36.669 or maybe, you know - but 0:25:36.669,0:25:40.028 even there was, like, more significant problems with this program or just the 0:25:40.028,0:25:42.759 style on the program is just really bad. 0:25:42.759,0:25:46.879 But even there, we don't stop. And you're, like, "Come on, man. Like, I thought the whole reason 0:25:46.880,0:25:51.490 was to simplify this." Don't worry. And it gets even better because we have a plus-plus 0:25:51.490,0:25:55.599 and a minus-minus. And at this point, we've run out of board space, so we can't go any further. 0:25:55.599,0:25:57.009 But a plus-plus 0:25:57.009,0:25:59.249 is just outrageous, 0:25:59.249,0:26:02.409 right? It's the kind of thing - so this is the kind of thing your section leader can't 0:26:02.409,0:26:03.399 actually give you 0:26:03.398,0:26:05.679 without coming and talking to Ben and I first 0:26:05.680,0:26:09.480 because they get a program that just goes - it has to actually exceed the 0:26:09.480,0:26:11.860 requirements for the assignment. It's by a long shot. 0:26:11.859,0:26:14.758 Like, you'll get all your assignment requirements, and what we encourage you 0:26:14.759,0:26:18.429 to do is you can do a grade assignment and get everything right and have good style, 0:26:18.429,0:26:21.710 and you'll be in this category. And for the later assignments, you may be in this category if it's 0:26:21.710,0:26:22.390 flawless. 0:26:22.390,0:26:25.659 But we'll actually - if you want to go for the plus-plus, 0:26:25.659,0:26:28.740 go beyond the assignment requirements. And the way we think about the plus-plus, it's a 0:26:28.740,0:26:30.659 program that makes you weep 0:26:30.659,0:26:32.040 in a good way. 0:26:32.039,0:26:35.000 It's just like your section leader sees it, and they're just, like, 0:26:35.000,0:26:38.558 this is so good, I've gotta show someone else. And they come and show Ben and 0:26:38.558,0:26:42.470 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, 0:26:42.470,0:26:43.380 like, 0:26:43.380,0:26:46.810 soft violin music playing in the background and we get out the wine and 0:26:46.809,0:26:47.720 cheese. 0:26:47.720,0:26:52.880 So this is just, like, this is the kind of thing that gets you, like, 0:26:52.880,0:26:56.350 remembered and the, oh, if you want a letter of recommendation, just ask because you got 0:26:56.349,0:26:59.349 a plus-plus. Like, oh, 0:26:59.349,0:27:03.168 it's awesome, right? There are very few of these in a quarter. So just by sort of 0:27:03.169,0:27:06.460 way of comparison, in a class this size, probably throughout the span of the 0:27:06.460,0:27:09.950 whole quarter, I'd expect there to be maybe ten plus-pluses, 0:27:09.950,0:27:13.610 I mean, ten assignment plus-pluses, not ten students who get plus-pluses across the 0:27:13.609,0:27:13.959 board. 0:27:13.960,0:27:16.808 So it's really something to strive for, but if you strive for it, 0:27:16.808,0:27:20.599 like, we're giving you the credit for it. And this gets remembered and you get, like, 0:27:20.599,0:27:22.699 extra credit and everything. 0:27:22.700,0:27:25.019 So we're left with this, 0:27:25.019,0:27:29.849 right? This assignment also makes you weep, 0:27:29.849,0:27:33.309 but not in the good way, right? It makes you kind of weep in the sense, like, I look at 0:27:33.309,0:27:34.769 them and I'm, like, 0:27:34.769,0:27:39.319 oh, man, like, what did I teach? Like, where did I go wrong, right? I, like, 0:27:39.319,0:27:40.619 blame myself. 0:27:40.619,0:27:44.629 I blame you a little bit, but I blame myself. 0:27:44.630,0:27:47.450 And this is really just, like, the program is just, like, it's a 0:27:47.450,0:27:50.830 shell. Like, there really wasn't much effort that was put into it. Yeah, you slapped something together 0:27:50.829,0:27:53.139 or it doesn't really work, 0:27:53.140,0:27:56.030 that whole deal. And then if you don't turn anything in, we do kind of reserve the 0:27:56.029,0:27:58.579 zero to distinguish from the 0:27:58.579,0:28:02.720 "made really bad effort" versus "didn't make any effort at all." 0:28:02.720,0:28:06.410 And we just won't talk about these, right? Let's just hope we can avoid those 0:28:06.410,0:28:10.100 if possible. But that's kind of how the grading scale works now. Now, 0:28:10.099,0:28:13.859 at the same time, I trust all of you to be responsible people. 0:28:13.859,0:28:17.329 And every once in a while, something bad happens to a good person, and 0:28:17.329,0:28:20.558 there's an assignment that you'd like to be able to turn in, but for whatever reason, you 0:28:20.558,0:28:23.710 can't turn in on time. And I just wanna treat you like adults. 0:28:23.710,0:28:27.700 I don't want you to have to worry about coming in and asking for an extension 0:28:27.700,0:28:31.298 or, like, "Oh, I had this really hard thing in another class, and I couldn't do it at the same time." Up 0:28:31.298,0:28:32.109 front, 0:28:32.109,0:28:34.229 everyone gets two free extensions, okay? So 0:28:34.230,0:28:38.930 in terms of late days - we refer to these as late days, strangely enough - you 0:28:38.930,0:28:40.509 get two free ones. 0:28:40.509,0:28:44.440 What a late day is, is a class day. They're not 24-hour days, but class days. 0:28:44.440,0:28:48.059 So if something is due on a Wednesday, you turned in on a Friday, that's a late 0:28:48.059,0:28:49.059 day. That's one. 0:28:49.059,0:28:51.888 You turn it in on the following Monday, that's two late days. 0:28:51.888,0:28:54.599 You can split up your two late days among two different assignments. You can use 0:28:54.599,0:28:56.148 them both on one assignment. 0:28:56.148,0:28:59.819 But we encourage you to not use them at all because if you use your late days, you fall behind 0:28:59.819,0:29:00.868 in the class. 0:29:00.868,0:29:05.038 The way you should think about these things are these are pre-approved extensions. 0:29:05.038,0:29:08.190 They're not the kind of thing where you just think, "Oh, yeah, I'm not gonna do the 0:29:08.190,0:29:11.190 assignment because I wanna go and play Frisbee golf," right? 0:29:11.190,0:29:14.330 Think of it, well, you wouldn't come ask me for an extension - you might, but you probably wouldn't 0:29:14.329,0:29:17.619 ask me for an extension if you're, like, "Hey, hey, Mehran, can I turn in the 0:29:17.619,0:29:19.599 assignment, like, on Wednesday because 0:29:19.599,0:29:22.719 I'm playing Frisbee golf this afternoon," right? If you would feel embarrassed 0:29:22.720,0:29:25.798 asking that question, you probably don't wanna use one of your free late days. 0:29:25.798,0:29:27.460 But something happens like, 0:29:27.460,0:29:30.809 oh, it's a tough week, you've got midterms in other classes and you got this assignment 0:29:30.809,0:29:32.879 due or whatever, that's a good time to use it. 0:29:32.880,0:29:36.280 So we just trust you. And most people, we actually encourage you not to use them 0:29:36.279,0:29:39.170 because it just makes you fall behind in the class. 0:29:39.170,0:29:42.200 Because we trust you and we give you these two up front, getting extensions 0:29:42.200,0:29:45.809 beyond your two free class days is virtually impossible because we sort of 0:29:45.809,0:29:46.539 up front said, 0:29:46.539,0:29:49.210 hey, it's your responsibility. We're giving you two freebies. 0:29:49.210,0:29:52.470 We're not gonna give you a third extension. Imagine if you had to come ask us for three 0:29:52.470,0:29:55.539 extensions. By the third one, we'd be, like, okay, what's going on, which is why 0:29:55.539,0:29:57.710 we don't necessarily give extensions beyond these two. 0:29:57.710,0:30:00.858 The only time we might give an extension beyond the two free ones is for 0:30:00.858,0:30:02.149 something major, like 0:30:02.150,0:30:06.300 death in the family or, like, serious medical problems that might require surgery or 0:30:06.299,0:30:07.250 something like that. 0:30:07.250,0:30:10.349 Every once in a while, unfortunately, that happens. I hope it doesn't happen in this 0:30:10.349,0:30:10.738 class. 0:30:10.739,0:30:13.869 But those are the only kinds of things that we give extensions to beyond the two 0:30:13.868,0:30:15.058 free late days. 0:30:15.058,0:30:18.739 Importantly, don't ask your section leader for extensions. They cannot grant you 0:30:18.739,0:30:22.249 extensions. Only Ben, who has all the power in this class, can give extensions, which 0:30:22.249,0:30:25.308 is why you should get to know Ben and then hopefully you won't need to talk to him about 0:30:25.308,0:30:27.629 extensions, okay? So 0:30:27.630,0:30:31.610 other thing to keep in mind is that three days late is the max. 0:30:31.609,0:30:36.129 Beyond three days late, which is basically one class week, if you think 0:30:36.130,0:30:39.390 about late days being class days, we will not accept an assignment. And the reason 0:30:39.390,0:30:42.130 for that is at a certain point, you're so late, you're better off just doing the 0:30:42.130,0:30:44.120 next assignment, letting the old one go. 0:30:44.119,0:30:48.409 So to sort of enforce that policy, after three days, we don't accept that 0:30:48.410,0:30:51.259 assignment late anymore. It's just gonna be a zero if it's not turned in, okay? 0:30:51.259,0:30:53.200 And that just kind of forces you to keep up. 0:30:53.200,0:30:56.870 Couple other minor things, well, I shouldn't say they're minor things. They're actually kind of important. Exams: There's 0:30:56.869,0:30:59.539 two exams in this class. There's a midterm and a final. 0:30:59.539,0:31:04.259 Both of them are, well, I shouldn't say both. The midterm is out of class. It's 0:31:04.259,0:31:07.730 from 7:00 to 8:30 p.m. 0:31:07.730,0:31:13.250 on Tuesday, October 30. And it's on the syllabus. It's there. It's on the syllabus; it's 0:31:13.250,0:31:16.630 on Handout No. 1. We repeat it multiple times. The date will eventually be announced 0:31:16.630,0:31:18.019 when we get close to the midterm. 0:31:18.019,0:31:22.460 But if you have a conflict with this time, you need to send me email, okay? 0:31:22.460,0:31:26.670 You can send me email a little closer to the midterm because I'll announce it again for people who have 0:31:26.670,0:31:27.179 conflicts. 0:31:27.179,0:31:31.759 But since it's an out-of-class exam, you need to send me email if you have a conflict. 0:31:31.759,0:31:34.868 I'll get all the constraints from people who have conflicts and try to schedule an 0:31:34.868,0:31:36.808 alternate time if there's enough people with conflicts. 0:31:36.808,0:31:40.879 But 7:00 to 8:30 is when you need to know about the midterm. And to make up for 0:31:40.880,0:31:43.420 the fact that we have an out-of-class midterm, I actually give you sort of 0:31:43.420,0:31:46.769 a belated free day, which is the Friday of the week of the midterm, we don't have 0:31:46.769,0:31:50.109 class to make up for the fact that we made you come to the midterm outside of class. 0:31:50.109,0:31:53.308 But the midterm's an hour and a half, and we can't compress time. If we could, we'd 0:31:53.308,0:31:54.480 have different issues. 0:31:54.480,0:31:57.308 We can't compress time and fit it into a 50 minute class, which is why it's 0:31:57.308,0:31:59.399 out of class, but you get a free day for it, 0:31:59.400,0:32:01.750 all right? Last but not least, 0:32:01.750,0:32:03.970 few things about grading. 0:32:03.970,0:32:06.490 Grading, one of those things as you might be able to tell from this little board 0:32:06.490,0:32:09.620 over here or something, if I didn't have to do it, I wouldn't do it 0:32:09.619,0:32:13.779 because honestly, as corny as this sounds, I just believe in the love of learning. 0:32:13.779,0:32:16.549 Like, I think if you're passionate about something, you just go do it and you 0:32:16.549,0:32:17.629 learn it. 0:32:17.630,0:32:21.550 But I'm na?ve, and so that's not the way learning always works. So sometimes we 0:32:21.549,0:32:24.859 actually need grading to make sure that learning takes place. And so this is how your 0:32:24.859,0:32:26.378 grade breaks down: 0:32:26.378,0:32:30.759 Forty-five percent of your grade is on the programming assignments, okay? 0:32:30.759,0:32:34.740 Fifteen percent is the midterm, which we'll just call the mid because we like to 0:32:34.740,0:32:36.380 abbreviate everything. 0:32:36.380,0:32:41.019 Thirty percent is the final. It's a three-hour final exam in the regular final 0:32:41.019,0:32:42.528 time slot for this class. 0:32:42.528,0:32:45.619 If you think or are under the delusion that you should take two 0:32:45.619,0:32:47.269 classes at the same time, 0:32:47.269,0:32:50.269 that's a bad idea because their final exams are at the same time, 0:32:50.269,0:32:54.349 okay? So you should not take two classes as the same time 0:32:54.349,0:32:57.649 because our final exam is scheduled for - I believe it's December 13, which 0:32:57.650,0:32:58.080 is a 0:32:58.079,0:33:01.730 Thursday, 12:15 to 3:15. That's the regular final exam slot for 0:33:01.730,0:33:05.210 this class. And any other class at the same time will conflict with that slot. Thirty 0:33:05.210,0:33:08.559 percent of your grade is the final. And that, if you add it all up, 0:33:08.559,0:33:12.589 it's not just that I'm bad with math. It's because 10 percent of your grade is actually 0:33:12.589,0:33:16.129 participation. And this is things like 0:33:16.130,0:33:19.240 did you go to your interactive grading sessions? Did you regularly attend 0:33:19.240,0:33:22.740 section? Did you participate in section? Did you participate in class, right? 0:33:22.740,0:33:26.259 And so, in order to help you participate in class, 0:33:26.259,0:33:29.890 there's a little incentive to participate in class, which is sugar in the afternoon. 0:33:29.890,0:33:32.980 So someone raise their hand. All 0:33:32.980,0:33:35.769 right. 0:33:35.769,0:33:38.220 Yeah, sometimes I'm not a good shot. And this will tell you, if you're sitting in 0:33:38.220,0:33:43.309 the back of the room, I can't throw a Kit Kat back there because they're a little 0:33:43.309,0:33:44.599 0:33:44.599,0:33:45.278 too light. Oh, yeah, sorry. 0:33:45.278,0:33:49.278 If you sit in the back of the room, the roof prevents me from actually being able to hit 0:33:49.278,0:33:53.359 you. So if you want the food, come up. But if you ask questions in class, 0:33:53.359,0:33:56.769 hey, that's a good time. It's just a little way to be able to reward you for 0:33:56.769,0:33:58.440 actually participating in class 0:33:58.440,0:34:01.139 or to keep your blood sugar up if you need it, all right? 0:34:01.138,0:34:05.008 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 0:34:05.009,0:34:08.599 every one of your section leaders to actually tell me how much you participated in class, and 0:34:08.599,0:34:11.918 some of them just say, "Oh, this person was wonderful. They came every time. They participated. 0:34:11.918,0:34:13.128 It's just a great thing." 0:34:13.128,0:34:15.858 And that helps your grade out a lot, okay? 0:34:15.858,0:34:17.469 Now, the final thing, 0:34:17.469,0:34:18.969 and as you can kind of tell, 0:34:18.969,0:34:21.399 most of the time, I'm not the most serious person in the world. I just like 0:34:21.400,0:34:24.059 to have fun with things, and I think it's important for you to have fun with 0:34:24.059,0:34:24.958 things. 0:34:24.958,0:34:28.277 There is just one place where I get real serious, and it's one place where Stanford 0:34:28.277,0:34:29.728 gets real serious. 0:34:29.728,0:34:32.848 Anyone wanna guess what that is? 0:34:32.849,0:34:35.899 Plagiarism and the honor code. As a matter of fact, that's what we call a social. So we 0:34:35.898,0:34:38.989 had someone down here who got it and then a whole bunch of people who I don't 0:34:38.989,0:34:44.967 know, so we just spray. All right. 0:34:44.969,0:34:47.969 So the honor code, 0:34:47.969,0:34:50.369 in terms of the honor code, the 0:34:50.369,0:34:54.559 question comes up is what is the honor code all about, and how does that affect working 0:34:54.559,0:34:57.609 in groups and computer science, etc.? 0:34:57.608,0:35:00.058 Does that mean we shouldn't talk to each other? 0:35:00.059,0:35:03.989 No. The answer to all those is no, okay? If you look at Handout No. 4, 0:35:03.989,0:35:05.809 which is all about the honor code, 0:35:05.809,0:35:08.849 we encourage you to talk to each other. We encourage you to talk about concepts 0:35:08.849,0:35:12.110 in the class, talk about different strategies to problems, to think about 0:35:12.110,0:35:14.659 the ways that you could potentially approach some problem or 0:35:14.659,0:35:17.739 the way different control constructs when we eventually get to them work in the 0:35:17.739,0:35:20.659 class. And discussion is perfectly fine, 0:35:20.659,0:35:23.729 especially among the course staff, but also amongst yourselves. That's a great 0:35:23.728,0:35:24.578 thing. 0:35:24.579,0:35:28.359 So where do we draw the line? And we try to make a bright line for where you've 0:35:28.358,0:35:31.929 crossed the line for the honor code, which is 0:35:31.929,0:35:35.318 don't share code, 0:35:35.318,0:35:36.429 plain and simple, 0:35:36.429,0:35:38.450 in any respect, okay? 0:35:38.449,0:35:41.848 Don't give a file to someone else that's got your code in it. Don't get code 0:35:41.849,0:35:45.229 from someone else. Don't look at someone else's printout. Don't give them a 0:35:45.228,0:35:45.659 printout. 0:35:45.659,0:35:49.190 If you have two people who are sitting looking at the same screen together, 0:35:49.190,0:35:51.159 that code can't belong to both of you. 0:35:51.159,0:35:52.358 It belongs to one of you. 0:35:52.358,0:35:56.028 I don't know which one, but it becomes an honor code violation. So you shouldn't 0:35:56.028,0:35:59.059 both - two people shouldn't be staring at the monitor together. 0:35:59.059,0:36:02.829 If it ever gets to the point where you're looking at someone else's code, that's 0:36:02.829,0:36:05.228 where you're gonna reach an issue, okay? 0:36:05.228,0:36:07.408 Discuss as much as you want. That's great. 0:36:07.409,0:36:10.429 Write your own code. That's all we care about. And you're, like, "Well, what is 0:36:10.429,0:36:14.880 code, Mehran? What does that word mean?" Code is geek speak for your program, 0:36:14.880,0:36:18.079 so when you program, the program that you write is what we affectionately refer to 0:36:18.079,0:36:19.329 as code. 0:36:19.329,0:36:23.028 And the idea of programming is what we refer to as coding, 0:36:23.028,0:36:25.639 strangely enough. Computer scientists need to make everything 0:36:25.639,0:36:28.160 more complicated than it really is so we can 0:36:28.159,0:36:31.449 get people under the illusion that they should pay us lots of money to do what we do. 0:36:31.449,0:36:35.409 I mean, you're, like, "Oh, I just write programs." And they're, like, "Oh, yeah, I should pay you 0:36:35.409,0:36:38.348 half." And you're, like, "No, no, no. I write code." And they're, like, "Oh, yeah." Suddenly, it's much more 0:36:38.349,0:36:40.009 impressive. So 0:36:40.009,0:36:40.920 don't share code. 0:36:40.920,0:36:44.780 The other thing is if you talk to other people, like if you have a study group to 0:36:44.780,0:36:48.220 talk about solution approaches or you go, let's say, talk to the TA or your section 0:36:48.219,0:36:48.648 leader 0:36:48.648,0:36:51.318 to how you should approach a problem, and they give you a lot of hints as to how 0:36:51.318,0:36:52.739 to do it, 0:36:52.739,0:36:55.528 cite collaboration. 0:36:55.528,0:37:00.119 So cite and collaboration gets you out of trouble. Any collaboration that you cite 0:37:00.119,0:37:03.250 you cannot be held responsible for under the honor code. 0:37:03.250,0:37:06.949 You can actually copy someone else's program and say, "I copied this program 0:37:06.949,0:37:08.228 from Mary Smith." 0:37:08.228,0:37:09.748 And I'll look at that and say, 0:37:09.748,0:37:12.598 "They cited it," and it will warm the cockles of my heart. 0:37:12.599,0:37:15.769 And Mary Smith will get full credit, and you'll get a zero because you copied your 0:37:15.768,0:37:17.218 program from Mary Smith, 0:37:17.219,0:37:22.289 but it's not an honor code violation because you cited the work, okay? So 0:37:22.289,0:37:26.929 the bottom line is keep yourself safe and cite your collaborations. And I 0:37:26.929,0:37:29.450 guarantee you most of the time, you'll be just fine. 0:37:29.449,0:37:32.439 Now, you might wonder why do I make such a big deal about this. And the reason I 0:37:32.440,0:37:35.470 make a big deal about this is for a while, thankfully it's not true anymore, but 0:37:35.469,0:37:36.359 for a while, 0:37:36.360,0:37:39.890 the computer science department actually had more honor code violations than the 0:37:39.889,0:37:43.118 rest of the university combined. 0:37:43.119,0:37:45.519 Take everything else in the university, put them all together, they were like over 0:37:45.518,0:37:48.808 here. And we're, like, we're computer science, 0:37:48.809,0:37:52.450 which is not a fun distinction to have, let me tell you. 0:37:52.449,0:37:55.368 And you might wonder why is that? Is that because computer science people are just 0:37:55.369,0:37:58.028 mischievous and dishonest? No. 0:37:58.028,0:38:01.898 It's because it's easier to catch honor code violations in computer science. We have a 0:38:01.898,0:38:05.118 whole bunch of tools that allow us - then we take all your programs and we run them through 0:38:05.119,0:38:07.809 this tool, and it compares them not only to everyone else in here, but, like, 0:38:07.809,0:38:11.119 to everyone from the last, like, X years where X is the large number of people who've 0:38:11.119,0:38:13.209 ever gone through the classes, right? 0:38:13.208,0:38:16.588 And it's an extremely good tool from finding where honor code violations 0:38:16.588,0:38:17.029 happen, 0:38:17.030,0:38:18.909 from where they don't. And it 0:38:18.909,0:38:23.139 doesn't find spurious violations. To be honest, I've never lost an honor code 0:38:23.139,0:38:24.349 case. When I 0:38:24.349,0:38:26.480 find an honor code case, 0:38:26.480,0:38:27.630 it is blatant. 0:38:27.630,0:38:30.110 And you take it to judicial affairs, and they look at it, and they're, like, 0:38:30.110,0:38:31.269 yeah, this is blatant. 0:38:31.268,0:38:34.318 And I take it to the student, and every student I've ever confronted them 0:38:34.318,0:38:38.139 with never said, "No, no, no. I didn't cheat." They said, "You caught me," okay? 0:38:38.139,0:38:41.639 So it's blatant. It's not like, oh, there's some little line in it, "Oh, am I gonna need to 0:38:41.639,0:38:43.638 worry about an honor code violation?" 0:38:43.639,0:38:47.249 Remember those rules, you have nothing to worry about in this class. It's people who go and, 0:38:47.248,0:38:50.748 like, fish out printouts from the recycle bins and copy other people's 0:38:50.748,0:38:53.329 code that are the people we catch, right? It's blatant cheating 0:38:53.329,0:38:54.179 that we catch. 0:38:54.179,0:38:55.090 But we catch it. 0:38:55.090,0:38:59.298 We catch it all the time. So I hope, I pray it doesn't happen in this class. 0:38:59.298,0:39:02.038 But the reason I make a big deal about it is historically if I look at the 0:39:02.039,0:39:05.630 evidence, it happens and we catch it. And when we catch it, we're required by the 0:39:05.630,0:39:09.088 university to prosecute. And I feel bad because usually it's someone who just made a 0:39:09.088,0:39:10.179 bad call, like, 0:39:10.179,0:39:13.289 they were up way too late the night before working on something else, and 0:39:13.289,0:39:16.909 they're not thinking straight. And rather than just taking a late day or turning in their 0:39:16.909,0:39:19.608 assignment late and getting a slight penalty on it beyond their two free late 0:39:19.608,0:39:20.369 days, 0:39:20.369,0:39:23.470 they decide to cheat. And that's just always the wrong call, okay? 0:39:23.469,0:39:26.879 So you just don't wanna put yourself in that situation. So I get real serious 0:39:26.880,0:39:31.778 about it for a moment, and hopefully it won't be an issue and we can just kind of go on, okay? 0:39:31.778,0:39:35.088 So with that said, that's a whole bunch of logistical stuff. 0:39:35.088,0:39:38.108 Any questions about the logistics of this class or anything I just talked 0:39:38.108,0:39:42.929 about? Uh huh? You had briefly mentioned the late penalty. 0:39:42.929,0:39:44.410 Oh, the late penalty, good point. 0:39:44.409,0:39:46.399 So remember our little bucket scale. 0:39:46.400,0:39:50.349 If you go beyond your two free late days, every day you turn in an assignment late beyond 0:39:50.349,0:39:52.319 those, it drops down one bucket. 0:39:52.320,0:39:55.550 So let's say you already used your two free late days on Assignment No. 1. And on 0:39:55.550,0:39:58.310 Assignment No. 2, you turned in something one day late and you would have gotten a 0:39:58.309,0:40:00.179 check normally, it becomes a check minus. 0:40:00.179,0:40:06.108 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? 0:40:06.108,0:40:09.308 Yeah, the sign-ups, well, they take into consideration your preference, but 0:40:09.309,0:40:12.369 part of your preference is to do the match is first come, first served. 0:40:12.369,0:40:14.899 So you wanna sign up early. 0:40:14.898,0:40:15.778 Oh, 0:40:15.778,0:40:17.518 thanks for your honesty. As a matter of fact, 0:40:17.518,0:40:20.699 I dig honesty, all right? 0:40:20.699,0:40:23.679 Any other questions? 0:40:23.679,0:40:29.058 It's just honesty's cool. Uh huh? How much time should we plan on studying [inaudible]? 0:40:29.059,0:40:32.039 Oh, good question. How much time should you plan? And this is something that I say for 0:40:32.039,0:40:34.470 classes in general at Stanford, which is not always true, 0:40:34.469,0:40:37.559 which is take the number of units that a class is, 0:40:37.559,0:40:43.128 multiply it by three. That's how many hours you'll spend per week in that class, total, 0:40:43.128,0:40:44.230 on average. 0:40:44.230,0:40:47.719 So what that means is in 106A, a 5 unit class, you multiply by 3, you 0:40:47.719,0:40:49.029 get 15. 0:40:49.030,0:40:52.390 Five of those hours are roughly spent between class, section, interactive grading, 0:40:52.389,0:40:53.289 other stuff. 0:40:53.289,0:40:57.050 That means on average about ten hours a week will be spent on your assignments 0:40:57.050,0:40:58.310 in this class. 0:40:58.309,0:41:01.690 Again, that's an average. Sometimes when I go to computer science conferences, I sit there and joke 0:41:01.690,0:41:04.380 around with plans. And we're, like, "Oh, how long did your assignments take?" 0:41:04.380,0:41:07.619 And I say, "Oh, on average, ten hours." And what I really mean when I say on average 10 0:41:07.619,0:41:07.999 hours 0:41:07.998,0:41:10.858 is they take between 3 and 45, 0:41:10.858,0:41:14.058 okay? It's a large variance event, right? 0:41:14.059,0:41:17.439 Ten is the average. Some people take a really long time. Some people get through it 0:41:17.438,0:41:21.358 really quickly, but that's about the average you can plan for. Uh huh? 0:41:21.358,0:41:27.598 Another question? [Inaudible] late days [inaudible] class days? 0:41:27.599,0:41:32.009 Yeah, all late days are class days, so the free ones - 0:41:32.009,0:41:35.579 the halfway mark's really my reach. That's about it. 0:41:35.579,0:41:39.900 All right. So I do wanna give you your very beginning of an introduction to 0:41:39.900,0:41:42.778 programming before we sort of break for the day. How 0:41:42.778,0:41:45.880 are we doing on time? 0:41:45.880,0:41:49.108 And so in order to kind of see this, 0:41:49.108,0:41:51.739 there's a few things that we wanna keep in mind. Actually, let me show you a 0:41:51.739,0:41:54.989 little picture, okay? 0:41:54.989,0:41:56.829 Sometimes 0:41:56.829,0:41:59.239 when we talk about writing programs, 0:41:59.239,0:42:01.539 we talk about debugging programs, 0:42:01.539,0:42:04.728 right? How many people ever heard the term debugging or bugs in programs? 0:42:04.728,0:42:08.208 A bug in a program is an error in a program, so sometimes when you hear us 0:42:08.208,0:42:12.678 say, "Oh, come see," like, your section leader to help debug or see the helpers in LaIR. 0:42:12.679,0:42:16.039 That's another thing. In the Tresidder computer cluster is the LaIR. 0:42:16.039,0:42:18.579 It's a computer cluster that we have helpers there to help you get through 0:42:18.579,0:42:21.189 this class. What is it? 0:42:21.188,0:42:21.978 Sunday through 0:42:21.978,0:42:26.668 Thursday, every week, from around 2:00 in the afternoon 'til midnight every day, okay, 0:42:26.668,0:42:29.668 to help you get through the class. So that's a good place if, you know, you can 0:42:29.668,0:42:32.558 work in your dorm room certainly, but if you also want help, go to the Tresidder 0:42:32.559,0:42:36.149 computer cluster, and there will be helpers there. There's a little queue you sign up for 0:42:36.148,0:42:38.588 to get help, and that's a great place, and it's all explained in Handout 0:42:38.588,0:42:39.349 No. 1, 0:42:39.349,0:42:41.199 but that's just something to keep in mind. 0:42:41.199,0:42:44.509 Where the term debugging comes from, it turns out this is an apocryphal story, but I'll tell 0:42:44.509,0:42:45.429 you anyway. 0:42:45.429,0:42:48.679 Back in the days of yore, in 1945 actually, there was a computer called the 0:42:48.679,0:42:52.079 Mark II at Harvard. And there was a woman named Grace Murray Hopper. Anyone ever 0:42:52.079,0:42:54.168 heard of Grace Murray Hopper? 0:42:54.168,0:42:58.328 A few folks. She was actually the first woman who was an admiral in the navy. 0:42:58.329,0:43:01.859 And she was also one of the very early pioneers of computer programming. She did 0:43:01.858,0:43:05.068 a lot of computer programming when she was actually a captain, and she was stationed 0:43:05.068,0:43:08.829 at Harvard as part of some sort of navy thing. I don't know why, but that's what 0:43:08.829,0:43:09.440 happened. 0:43:09.440,0:43:12.039 And they had this huge computer there, and they were noticing the computer was 0:43:12.039,0:43:14.900 on the fritz, and they couldn't understand what was wrong. And this is one of these 0:43:14.900,0:43:17.970 big old machines in the days of yore that has vacuum tubes and stuff inside it. 0:43:17.969,0:43:21.079 So they walked inside the computer, right, because then you could actually open it up 0:43:21.079,0:43:23.009 and walk inside your computer. 0:43:23.009,0:43:25.248 And they saw this, 0:43:25.248,0:43:27.889 and I don't know if you can see that, but that's a moth. 0:43:27.889,0:43:31.858 It was a moth that had sort of given its life to be immortalized because it had actually 0:43:31.858,0:43:35.028 shorted out across two relays in the computer 0:43:35.028,0:43:36.579 and was causing these sort of 0:43:36.579,0:43:39.829 errors to happen on the fritz. And so they took the bug out, and once 0:43:39.829,0:43:43.380 they actually plucked this little charred bug out of there, the computer started 0:43:43.380,0:43:47.910 working fine again, and she taped it in her log book. And this log book's actually 0:43:47.909,0:43:51.588 preserved in the Smithsonian Institution now, which is where all this comes 0:43:51.588,0:43:54.529 from. Here's all the standard disclaimer information: "Image used under fair use for 0:43:54.530,0:43:58.079 education purposes. Use of this image is exempt from Creative Commons 0:43:58.079,0:43:59.880 and other licenses," just so you know. 0:43:59.880,0:44:02.039 Now the lawyers are happy. 0:44:02.039,0:44:06.119 But this is where we think of sort of the modern term debugging actually came from. 0:44:06.119,0:44:09.439 Now, it turns out the actual story is that the term debugging came from the 0:44:09.438,0:44:11.178 1800s, in the late 1800s 0:44:11.179,0:44:15.088 from mechanical devices. People actually referred to debugging as fixing mechanical 0:44:15.088,0:44:15.739 devices. 0:44:15.739,0:44:20.038 But this is kind of the apocryphal story for how it comes up in computer science. Now, 0:44:20.039,0:44:21.849 with that said, 0:44:21.849,0:44:25.109 what is the platform in which you're gonna sort of do your first debugging or 0:44:25.108,0:44:28.058 your first work on? We talked about Java, but in fact in this class, we're not 0:44:28.059,0:44:29.369 gonna start with Java. 0:44:29.369,0:44:32.778 We're gonna start with something even sort of simpler than Java because as I 0:44:32.778,0:44:36.259 mentioned, sometimes what happens in computer science is people learn all the features 0:44:36.259,0:44:39.748 of some language. And they think just knowing the language makes them a good 0:44:39.748,0:44:40.679 software engineer. 0:44:40.679,0:44:43.659 And they get so worried about all the features of the language 0:44:43.659,0:44:46.068 that they don't kind of think about the big picture. 0:44:46.068,0:44:49.259 And so there was a guy named Rich Pattis, who oddly enough was actually a grad 0:44:49.259,0:44:51.250 student at the time at 0:44:51.250,0:44:51.858 Stanford, 0:44:51.858,0:44:55.208 and he said, "You know what? If we're gonna teach computer science, when we first start out, why don't 0:44:55.208,0:44:58.599 we have people not worry about all of the different 0:44:58.599,0:45:00.779 commands of the language and all the different things they can do? 0:45:00.780,0:45:04.389 Let's start with something really simple so you can learn all the commands 0:45:04.389,0:45:08.169 real quick. And then you've mastered everything there is to master about that 0:45:08.168,0:45:11.708 language, and you can focus on the software engineering concepts." And it turns out to 0:45:11.708,0:45:15.048 be a brilliant idea, which has actually been adopted by a bunch of people. 0:45:15.048,0:45:19.409 And so Rich, who's a wonderfully friendly guy - sometime if we get him to 0:45:19.409,0:45:22.818 come to Stanford, I'll introduce you; he's just very nice - 0:45:22.818,0:45:27.318 came up with this thing called Karel the Robot. And 0:45:27.318,0:45:29.259 the term, "Karel" 0:45:29.259,0:45:31.748 actually comes from 0:45:31.748,0:45:36.308 Karel Capek. 0:45:36.309,0:45:40.039 Anyone know who he is? Oh, free candy. Uh huh? He coined the term, 0:45:40.039,0:45:42.949 "robot." 0:45:42.949,0:45:45.959 He coined the term, "robot." He was a Czech playwright who actually wrote a play 0:45:45.958,0:45:48.199 called, "RUR," 0:45:48.199,0:45:52.409 which was about robots. And the word robot actually comes from a Czech word, the 0:45:52.409,0:45:53.969 Czech word for work. 0:45:53.969,0:45:57.940 And so the robot is named after 0:45:57.940,0:46:01.338 Karel. And some people say Karl, which is kind of actually closer to I believe if - I 0:46:01.338,0:46:03.969 don't know if there's anyone who speaks Czech in the room - but closer to the 0:46:03.969,0:46:06.439 actual pronunciation. But we say Karel these days because it's kind of like 0:46:06.440,0:46:07.909 gender neutral, okay? 0:46:07.909,0:46:09.869 And so Karel the Robot 0:46:09.869,0:46:13.318 is basically this robot that lives in a really simple world. And so I'll show you 0:46:13.318,0:46:16.289 all that you can meet Karel the Robot. He's friendly; he's fun. 0:46:16.289,0:46:18.588 I'll show you Karel the Robot. 0:46:18.588,0:46:21.239 0:46:21.239,0:46:25.969 So we gotta get Karel running. He's at the factory. He's getting souped up. We're energizing Karel. 0:46:25.969,0:46:29.418 You gotta add some color to it. Otherwise - 0:46:29.418,0:46:31.248 all right. 0:46:31.248,0:46:34.558 We're begging for him. Come on, Karel. 0:46:34.559,0:46:37.459 There he is. Oh, 0:46:37.458,0:46:41.538 yeah. 0:46:41.539,0:46:45.259 That's Karel the Robot. He looks like one of the old Macintoshes if you remember the original 0:46:45.259,0:46:48.289 Macintoshes that look like a lunch pail, except he's got legs. 0:46:48.289,0:46:51.788 One sticks out his back. That's just the way it is. 0:46:51.789,0:46:56.819 And the way Karel works is he lives in a grid. To you, it may not be exciting, but to 0:46:56.818,0:46:58.630 Karel, it's way exciting. 0:46:58.630,0:47:03.179 So Karel lives in this little grid, and the way the grid works is there are streets and 0:47:03.179,0:47:06.789 avenues in the grid. Streets run horizontally, so this is First Street, 0:47:06.789,0:47:08.430 Second Street, Third Street. 0:47:08.429,0:47:11.559 And then over here, we have avenues, First Avenue, Second Avenue, Third 0:47:11.559,0:47:14.750 Avenue, Fourth Avenue, Fifth Avenue. It's kind of like Karel lives in Manhattan if you wanna 0:47:14.750,0:47:16.338 think about it that way, okay? 0:47:16.338,0:47:19.748 So Karel always is on one of these corners. So right now, he's at the corner of 0:47:19.748,0:47:22.788 First Street and First Avenue, or we just refer to it as 1 1 if you wanna 0:47:22.789,0:47:25.130 think about sort of Cartesian coordinates, right? But 0:47:25.130,0:47:26.780 just think of them as streets and avenues. 0:47:26.780,0:47:28.609 That's where Karel lives. 0:47:28.608,0:47:32.278 And Karel can move around in this world. There's a bunch of things that Karel can do. 0:47:32.278,0:47:33.889 He can take steps forward. 0:47:33.889,0:47:36.939 He can turn around to face different directions, and he can sense certain 0:47:36.938,0:47:38.288 things about his world. 0:47:38.289,0:47:41.400 So there's some things that exist in Karel's world, okay? 0:47:41.400,0:47:45.340 Things like walls that Karel cannot move through, right, so his world has 0:47:45.340,0:47:48.740 walls all around it that he can't go through, so he can't fall off the end of the 0:47:48.739,0:47:49.139 world. 0:47:49.139,0:47:52.629 And there's other walls like this one if Karel were over here, he can't step through 0:47:52.630,0:47:54.169 that wall. 0:47:54.168,0:47:57.768 There's also something referred to as beepers in Karel's world. And what a 0:47:57.768,0:48:00.488 beeper is, is it's like a big diamond, 0:48:00.489,0:48:03.909 okay? But what a beeper really is, is basically just some marker that he puts in 0:48:03.909,0:48:06.510 the world. You can think of a beeper like a piece of candy. 0:48:06.510,0:48:10.530 And Karel just goes around, like, putting pieces of candy in the world. As a matter of fact, not 0:48:10.530,0:48:12.999 only does he put pieces of candy in the world, 0:48:12.998,0:48:17.948 he carries around a whole bag of candy. So he has a beeper bag with him, and 0:48:17.949,0:48:21.099 sometimes that bag has a whole bunch of beepers in it; sometimes it only has one 0:48:21.099,0:48:22.318 beeper; sometimes, 0:48:22.318,0:48:25.998 it's sad Karel, and he has no beepers. But he's still got the bag. 0:48:25.998,0:48:28.798 There just don't happen to be any beepers in it. So he can potentially, if he 0:48:28.798,0:48:32.628 come across a beeper in his world, he can pick it up and put it in his bag, 0:48:32.628,0:48:35.509 or he can take, if he's got beepers in his bag, he can take them out of his bag 0:48:35.509,0:48:37.340 and put them places in the world. 0:48:37.340,0:48:40.860 And corners in the world can have either zero - if they have no beepers, they just appear 0:48:40.860,0:48:41.920 like a little dot - 0:48:41.920,0:48:44.059 or one or more beepers 0:48:44.059,0:48:47.199 on them that Karel can potentially pick up, okay? 0:48:47.199,0:48:51.229 So any questions about beepers or Karel having a little bag of beepers? 0:48:51.228,0:48:52.338 And that's it. 0:48:52.338,0:48:53.929 That's Karel. 0:48:53.929,0:48:57.298 That's his world. His world, we can make it larger if we want. We can put in walls in 0:48:57.298,0:49:00.219 different places. We can put beepers in different places. We can have Karel be in a 0:49:00.219,0:49:01.278 different place. 0:49:01.278,0:49:04.938 But starting next time, what you're gonna realize is with this extremely simple world, 0:49:04.938,0:49:08.558 there's actually some complicated things you can do. And after about a week - so 0:49:08.559,0:49:11.939 this first week, we're gonna focus on Karel - you'll notice that Karel is 0:49:11.938,0:49:15.658 actually a very nice, gentle introduction into Java. And a lot of the concepts that 0:49:15.659,0:49:20.148 we learn, sort of software engineering concepts using Karel, will translate over to the 0:49:20.148,0:49:21.969 Java world, okay? 0:49:21.969,0:49:25.338 So any questions about Karel or any of the other logistics that you've actually 0:49:25.338,0:49:28.599 heard about in the class? 0:49:28.599,0:49:33.619 Alrighty then. Welcome to 106A. I'll see you on Wednesday.