WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000 00:00:12.640 --> 00:00:15.410 >> SPEAKER 1: Hello world, this is CS50 Live. 00:00:15.410 --> 00:00:18.450 We'd like to begin this time with a shout out to our friends in St. Louis, 00:00:18.450 --> 00:00:21.450 Missouri, where a group of volunteers known as LaunchCode have been 00:00:21.450 --> 00:00:25.920 gathering together CS50x students in order to take the class collectively. 00:00:25.920 --> 00:00:29.250 And the goal ultimately is that, after the semester's end, is to pair those 00:00:29.250 --> 00:00:31.120 students with a local tech jobs. 00:00:31.120 --> 00:00:34.030 >> Now originally the LaunchCode folks, and the students involved, were going 00:00:34.030 --> 00:00:37.550 to convene in a local library where a few hundred people had RSVPed. 00:00:37.550 --> 00:00:40.950 But so many people ended up RSVPing in the end for this initiative, that they 00:00:40.950 --> 00:00:43.930 ended up moving to a local opera house, depicted here. 00:00:43.930 --> 00:00:44.770 >> Now it's a little small. 00:00:44.770 --> 00:00:48.320 But if you look ever so closely you can see up on stage that first slide 00:00:48.320 --> 00:00:53.240 from Week 0 that speaks to the fact that 73% of your classmates, perhaps 00:00:53.240 --> 00:00:55.650 including you, have no prior experience. 00:00:55.650 --> 00:00:58.420 And indeed that was very much the case in this opera house here. 00:00:58.420 --> 00:01:01.170 So our hellos to the folks at LaunchCode and the 00:01:01.170 --> 00:01:02.180 citizens of St. Louis. 00:01:02.180 --> 00:01:05.150 If you yourself live local to Saint Louis, do feel free to check them out 00:01:05.150 --> 00:01:07.520 at launchcodestl.com. 00:01:07.520 --> 00:01:12.450 Or, perhaps, turn on your local news channel as we'll do here for you. 00:01:12.450 --> 00:01:15.790 >> SPEAKER 2: An amazing opportunity for any Saint Louisan looking to land one 00:01:15.790 --> 00:01:18.030 of those high tech, high paying jobs. 00:01:18.030 --> 00:01:21.440 For the first time ever, the same computer programming class that's 00:01:21.440 --> 00:01:26.910 taught online by Harvard and MIT is being offered in person at the St. 00:01:26.910 --> 00:01:28.070 Louis Public Library. 00:01:28.070 --> 00:01:32.670 >> It is all thanks to the organization LaunchCode, which is trying to solve 00:01:32.670 --> 00:01:34.900 the tech talent gap here in St. Louis. 00:01:34.900 --> 00:01:39.420 Now anyone who passes this four month course is likely to get a paid 00:01:39.420 --> 00:01:43.260 apprenticeship that could turn into a computer programming job. 00:01:43.260 --> 00:01:47.010 LaunchCode's co-founder says, if you learn this skill set, in today's 00:01:47.010 --> 00:01:52.100 market you are almost guaranteed to land a six figure job in a couple of 00:01:52.100 --> 00:01:55.500 years, with a starting salary around $50,000. 00:01:55.500 --> 00:01:56.580 That sounds pretty good. 00:01:56.580 --> 00:02:00.930 So what kind of person should consider taking this class? 00:02:00.930 --> 00:02:03.890 >> JIM MCKELVEY: You have to be pretty smart, OK? 00:02:03.890 --> 00:02:06.690 You have to be extremely hard working. 00:02:06.690 --> 00:02:08.660 But you don't have to have gone to the best schools. 00:02:08.660 --> 00:02:09.930 You don't have to be great at math. 00:02:09.930 --> 00:02:13.380 You don't have to have some of the things that you may believe you need. 00:02:13.380 --> 00:02:16.360 And this course will tell you if you've got it. 00:02:16.360 --> 00:02:18.490 >> SPEAKER 2: Wow, now, if you are wondering if there are enough 00:02:18.490 --> 00:02:23.270 programming jobs available in St. Louis, the answer is a big yes. 00:02:23.270 --> 00:02:26.990 McKelvey says there are more than 1,000 open positions and just not 00:02:26.990 --> 00:02:29.250 enough local people trying to fill them. 00:02:29.250 --> 00:02:33.250 Now this class starts Monday at 5:30 at the Central Branch at the St. Louis 00:02:33.250 --> 00:02:34.530 Public Library. 00:02:34.530 --> 00:02:37.770 If you're interested, and I'm sure some of you will be, the information 00:02:37.770 --> 00:02:39.020 that ksdk.com. 00:02:41.582 --> 00:02:43.960 >> SPEAKER 1: Some of your classmates would now like to say hello. 00:02:43.960 --> 00:02:48.270 Up first is Suzanne, from Winthrop, Massachusetts, a nearby town just down 00:02:48.270 --> 00:02:50.022 the road from here. 00:02:50.022 --> 00:02:52.290 >> SUZANNE: Hello world, I'm Suzanne. 00:02:52.290 --> 00:02:56.790 I live in Winthrop, Massachusetts, United States, on the water. 00:02:56.790 --> 00:02:59.630 And I am 63 years old. 00:02:59.630 --> 00:03:01.480 I'm a retired nurse. 00:03:01.480 --> 00:03:05.860 I have four children and two grandchildren. 00:03:05.860 --> 00:03:09.220 >> I'm also a theater director and an actress. 00:03:09.220 --> 00:03:13.550 And sometime this year I'll be appearing in Discovery Channel's "The 00:03:13.550 --> 00:03:17.840 Boston Strangler." I play Zenovia Clegg. 00:03:17.840 --> 00:03:22.445 >> I'm taking CS50 because I love edX. 00:03:22.445 --> 00:03:24.595 I've taken two previous courses. 00:03:24.595 --> 00:03:32.850 I've taken Justice, and Public Health and Environmental Change. 00:03:32.850 --> 00:03:34.030 And I loved them. 00:03:34.030 --> 00:03:37.360 >> Also because computer science scares me a little. 00:03:37.360 --> 00:03:43.940 And in my age bracket we're encouraged to do things that frighten us. 00:03:43.940 --> 00:03:48.720 So I'm taking CS50 and looking forward to it. 00:03:48.720 --> 00:03:52.405 So my name is Suzanne, and this is CS50. 00:03:55.020 --> 00:03:58.460 >> SPEAKER 1: Up next are several hellos from some of your classmates in Brewer 00:03:58.460 --> 00:04:00.160 High School in Maine. 00:04:00.160 --> 00:04:02.010 Let's take a listen. 00:04:02.010 --> 00:04:04.640 >> BREWER HIGH SCHOOL STUDENTS: Hello world, we're Brewer High. 00:04:04.640 --> 00:04:05.945 >> PATRICK: Hi, I'm Patrick. 00:04:05.945 --> 00:04:07.490 >> ADAM: I'm Adam. 00:04:07.490 --> 00:04:09.020 >> NIKOLAI: I'm Nikolai. 00:04:09.020 --> 00:04:11.286 >> BEN: I'm Ben. 00:04:11.286 --> 00:04:12.660 >> DYLAN: I'm Dylan. 00:04:12.660 --> 00:04:13.930 >> NICK: I'm Nick. 00:04:13.930 --> 00:04:15.085 >> CHRISTINA: I'm Christina. 00:04:15.085 --> 00:04:16.069 >> JONATHAN: I'm Jonathan. 00:04:16.069 --> 00:04:17.000 >> CHARLES: I'm Charles. 00:04:17.000 --> 00:04:20.890 >> BREWER HIGH SCHOOL STUDENTS: And this is CS50. 00:04:20.890 --> 00:04:24.360 >> SPEAKER 1: Hello Brewer High School-- and now Stuart and a friend of his, 00:04:24.360 --> 00:04:26.320 from the nearby state of Virginia. 00:04:30.300 --> 00:04:33.170 >> STUART: Hello world, my name is Stuart. 00:04:33.170 --> 00:04:35.285 And I'm from Virginia. 00:04:35.285 --> 00:04:38.230 And this is my first time doing a Harvard course or any 00:04:38.230 --> 00:04:41.670 online course like that. 00:04:41.670 --> 00:04:44.980 I really like computers and want to learn more about them. 00:04:44.980 --> 00:04:47.900 I'm Stuart, and this is CS50. 00:04:47.900 --> 00:04:49.060 >> SPEAKER 1: Hello Stuart. 00:04:49.060 --> 00:04:51.900 So we've also been keeping an eye on Twitter, where one of your classmates, 00:04:51.900 --> 00:04:55.020 Umberto from Mexico, had this to tweet recently. 00:04:55.020 --> 00:04:57.270 Hey, @davidjmalan, let me ask you a question-- 00:04:57.270 --> 00:04:59.210 Mark Zuckerberg took CS50? 00:04:59.210 --> 00:05:03.450 >> So, sadly, Mark did not in fact take CS50 upon enrolling as a freshman here 00:05:03.450 --> 00:05:04.050 at Harvard. 00:05:04.050 --> 00:05:07.570 Rather he skipped ahead to a more advanced class known as CS51, which 00:05:07.570 --> 00:05:10.910 covers computer science topics like abstraction, and programming concepts 00:05:10.910 --> 00:05:13.900 like functional programming an object oriented programming. 00:05:13.900 --> 00:05:17.400 >> Now at the time it was taught by a professor named Henry Leitner, who 00:05:17.400 --> 00:05:19.890 actually taught the course when I took it as well. 00:05:19.890 --> 00:05:23.150 Our own preceptor, Rob Bowden, recently sat down with Professor 00:05:23.150 --> 00:05:28.060 Latiner to talk about a few of his former students besides me. 00:05:28.060 --> 00:05:31.620 >> ROB BOWDEN: Hi, I'm Rob Bowden, and I'm here with Dr. Henry Leitner, who's 00:05:31.620 --> 00:05:35.270 the Associate Dean of Information Technology at DCE, and Senior Lecturer 00:05:35.270 --> 00:05:36.660 in Computer Science. 00:05:36.660 --> 00:05:41.560 >> All right, so I've have heard that you've had some celebrities pass 00:05:41.560 --> 00:05:43.360 through some of your courses. 00:05:43.360 --> 00:05:45.540 >> HENRY LEITNER: All right, so I like to tell my students I've been at Harvard 00:05:45.540 --> 00:05:46.240 a long time. 00:05:46.240 --> 00:05:48.480 And when they say-- well how long have you been here?-- 00:05:48.480 --> 00:05:53.930 my answer is I'm old enough to have worked on homework assignments with 00:05:53.930 --> 00:05:56.740 that billionaire dropout Bill Gates. 00:05:56.740 --> 00:05:59.650 But I'm also young enough to have actually taught that billionaire 00:05:59.650 --> 00:06:02.960 dropout Mark Zuckerberg, of Facebook fame. 00:06:02.960 --> 00:06:08.600 >> So my encounter with Bill Gates goes way back to the beginning in the 1974, 00:06:08.600 --> 00:06:11.980 1975 academic year. 00:06:11.980 --> 00:06:15.810 The story is true that Bill Gates' friend Paul Allen went to news stand 00:06:15.810 --> 00:06:18.340 in Harvard Square and came upon in Popular Electronics Magazine, which 00:06:18.340 --> 00:06:21.170 was featuring a story about the world's first personal computer, which 00:06:21.170 --> 00:06:24.070 you had to actually build-- assemble from parts-- the Altair. 00:06:24.070 --> 00:06:26.060 He came running back to Bill Gates' dormitory. 00:06:26.060 --> 00:06:28.640 And they got all excited that the personal computer revolution was about 00:06:28.640 --> 00:06:29.760 to start without them. 00:06:29.760 --> 00:06:31.340 >> So at the time, Gates and I-- 00:06:31.340 --> 00:06:32.270 we were working on problems. 00:06:32.270 --> 00:06:35.635 That's because we were both enrolled in a theory of computation course, a 00:06:35.635 --> 00:06:37.690 very mathy graduate level course. 00:06:37.690 --> 00:06:40.690 And on the first day of class the professor told everyone in the room to 00:06:40.690 --> 00:06:43.910 turn to their neighbor and introduce themselves, and then collaborate with 00:06:43.910 --> 00:06:45.590 that person on problem sets. 00:06:45.590 --> 00:06:46.440 So Gates and I-- 00:06:46.440 --> 00:06:47.810 I didn't know who he was at the time. 00:06:47.810 --> 00:06:50.390 He was maybe sixteen or seventeen, but he looked like he was 00:06:50.390 --> 00:06:51.840 twelve, to be honest. 00:06:51.840 --> 00:06:54.010 >> And we started to work on homeworks together. 00:06:54.010 --> 00:06:57.710 But then when the Altair came out in Popular Electronics Magazine, caught 00:06:57.710 --> 00:06:58.760 his attention. 00:06:58.760 --> 00:06:59.890 He just disappeared. 00:06:59.890 --> 00:07:01.070 He stopped doing the homework. 00:07:01.070 --> 00:07:02.300 I got angry at him. 00:07:02.300 --> 00:07:06.750 >> And I would just watch him in the one computing lab we had at Harvard for 00:07:06.750 --> 00:07:09.340 research at the time, which was called the Aiken Computation Lab. 00:07:09.340 --> 00:07:10.980 A PDP-10 was being used. 00:07:10.980 --> 00:07:14.530 And he was hacking away day and night, basically just living there. 00:07:14.530 --> 00:07:19.040 >> As I found out later, he was actually designing software for the original 00:07:19.040 --> 00:07:22.180 Altair, an operating system, along with the programming language BASIC 00:07:22.180 --> 00:07:23.630 that was going to run. 00:07:23.630 --> 00:07:28.330 The idea being that for a personal computer industry to take off you 00:07:28.330 --> 00:07:29.630 would need to be able to write software. 00:07:29.630 --> 00:07:32.540 And writing programs and machine language by flipping toggle switches 00:07:32.540 --> 00:07:35.580 was not going to make it, except beyond the hobbyists. 00:07:35.580 --> 00:07:39.965 >> What was interesting at the time was the Altair was so popular you couldn't 00:07:39.965 --> 00:07:41.690 even buy one, certainly after it was announced. 00:07:41.690 --> 00:07:46.840 So Bill Gates, amazingly, with his friend Paul Allen, wrote a program on 00:07:46.840 --> 00:07:51.010 the PDP-10 that simulated the behavior of this Altair, because the specs were 00:07:51.010 --> 00:07:53.750 fully written up in the Popular Electronics Magazine. 00:07:53.750 --> 00:07:56.870 >> So, as I said, I got angry at him, I didn't pay attention. 00:07:56.870 --> 00:07:59.840 He disappeared, went off to Albuquerque, New Mexico, to show off 00:07:59.840 --> 00:08:02.220 what he had done to the folks who had built the Altair. 00:08:02.220 --> 00:08:07.580 And at the times, leaving college-- leaving Harvard-- to start a company 00:08:07.580 --> 00:08:08.720 was unheard of. 00:08:08.720 --> 00:08:11.320 And so when I found out that's what had happened I was done. 00:08:11.320 --> 00:08:13.770 Because I kept thinking about-- my parents would have killed me if I had 00:08:13.770 --> 00:08:17.020 dropped out of school just to go off and start a company. 00:08:17.020 --> 00:08:18.390 >> And then of course there's Mark Zuckerberg. 00:08:18.390 --> 00:08:23.530 I got to know him partly because he came after finishing CS51. 00:08:23.530 --> 00:08:25.690 I guess it was after [INAUDIBLE] had completed the course. 00:08:25.690 --> 00:08:30.000 He wanted to work as a teaching fellow in the subsequent year for CS51. 00:08:30.000 --> 00:08:31.370 And he came to the interview. 00:08:31.370 --> 00:08:35.690 >> And the truth of the matter is his performance was somewhat weak compared 00:08:35.690 --> 00:08:36.919 to the other folks who had interviewed. 00:08:36.919 --> 00:08:38.450 It was actually the weakest of the bunch. 00:08:38.450 --> 00:08:42.230 So I didn't feel as though I could in good conscience hire him. 00:08:42.230 --> 00:08:45.746 >> Plus, he was in a bit of trouble with the administrative board. 00:08:45.746 --> 00:08:48.100 If you saw the movie, The Social Network. 00:08:48.100 --> 00:08:50.430 OK, so much of it is factually true. 00:08:50.430 --> 00:08:55.040 At the time he had just finished doing the Facemash, not Facebook but the 00:08:55.040 --> 00:08:56.020 Facemash app. 00:08:56.020 --> 00:09:01.080 And he had brought down the Harvard network inadvertently. 00:09:01.080 --> 00:09:05.280 And plus he had stolen the faces of Harvard college undergraduate women to 00:09:05.280 --> 00:09:05.890 do this project. 00:09:05.890 --> 00:09:07.290 >> So he was brought to the administrative board. 00:09:07.290 --> 00:09:08.570 He was slapped on the hands. 00:09:08.570 --> 00:09:09.760 So he was in some trouble. 00:09:09.760 --> 00:09:12.290 And I think he was sort of disconcerted by that. 00:09:12.290 --> 00:09:15.890 >> So I like to tell people that I take a tiny, tiny bit of credit for the 00:09:15.890 --> 00:09:17.710 success of Facebook because-- 00:09:17.710 --> 00:09:21.970 A, at least one half or 1% of Zuckerberg's programming skill came 00:09:21.970 --> 00:09:23.125 from my course-- 00:09:23.125 --> 00:09:24.140 what he learned there. 00:09:24.140 --> 00:09:26.880 And secondly, had I hired him as a teaching fellow, he would not have had 00:09:26.880 --> 00:09:30.090 the time to complete Facebook at the point that he did. 00:09:30.090 --> 00:09:32.670 >> So it has been a lot of fun teaching computer science at Harvard. 00:09:32.670 --> 00:09:36.480 I mean there are just amazing people who go on to do great things. 00:09:36.480 --> 00:09:40.480 I could go on and tell you about other folks, but I think our time is up. 00:09:40.480 --> 00:09:43.310 >> ROB BOWDEN: So it sounds like Bill Gates owes you some money for causing 00:09:43.310 --> 00:09:45.260 all that stress in Theory of Computation. 00:09:45.260 --> 00:09:48.120 And Mark Zuckerberg owes you some money for letting him start Facebook. 00:09:48.120 --> 00:09:50.370 >> HENRY LEITNER: That's a nice way to think about, sure. 00:09:50.370 --> 00:09:52.180 >> ROB BOWDEN: All right, well thanks. 00:09:52.180 --> 00:09:53.575 This has been great. 00:09:53.575 --> 00:09:54.825 Thanks for having me. 00:09:57.150 --> 00:09:58.400 Shake his hand maybe. 00:10:01.606 --> 00:10:02.880 Should I shake his hand? 00:10:02.880 --> 00:10:04.560 Should we redo the ending? 00:10:04.560 --> 00:10:05.810 How should we do the ending? 00:10:11.430 --> 00:10:13.290 >> SPEAKER 1: Next, a question from [? Sin, ?] 00:10:13.290 --> 00:10:16.110 one of your classmates in Vietnam who had this to say. 00:10:16.110 --> 00:10:18.430 How do I contact other people in my country? 00:10:18.430 --> 00:10:19.565 Well this too is a great question. 00:10:19.565 --> 00:10:24.703 And if you log into the edX interface, for CS50x's main info page, you'll see 00:10:24.703 --> 00:10:29.520 a link to CS50 meetups, which will lead you to meetup.com/meet50, which 00:10:29.520 --> 00:10:32.650 is a tool that we've set up to allow you to find people who are local to 00:10:32.650 --> 00:10:35.820 you so that you can actually meet up, not only virtually with classmates 00:10:35.820 --> 00:10:38.020 this year, but in person as well. 00:10:38.020 --> 00:10:41.160 >> In fact, when you visit this URL, you'll see a map that looks like this, 00:10:41.160 --> 00:10:44.530 where every marker represents one or more of your classmates in that part 00:10:44.530 --> 00:10:45.350 of the world. 00:10:45.350 --> 00:10:49.150 Indeed right now, some of the most popular communities of CS50x students 00:10:49.150 --> 00:10:55.030 are in New York, London, Delhi, Cairo, and San Francisco, and over 199 other 00:10:55.030 --> 00:10:56.000 cities as well. 00:10:56.000 --> 00:10:59.150 So if interested in meeting up with some classmates locally, do head to 00:10:59.150 --> 00:11:02.050 meet meetup.com/meet50. 00:11:02.050 --> 00:11:06.150 >> A question now from Scott in New York, who had this question to write-- 00:11:06.150 --> 00:11:09.350 most every program uses strings, so why was printf included in the 00:11:09.350 --> 00:11:11.910 standard I/O library, and GetString was not? 00:11:11.910 --> 00:11:14.520 Is GetString a function defined in the CS50 library? 00:11:14.520 --> 00:11:18.090 >> So yes indeed, GetString is indeed defined in CS50's library. 00:11:18.090 --> 00:11:20.760 And printf, meanwhile, is in the standard I/O library. 00:11:20.760 --> 00:11:24.630 Now back in the day, when C was invented, surely it was important, a 00:11:24.630 --> 00:11:28.750 fundamental functionality for code like printf to actually print 00:11:28.750 --> 00:11:29.545 something to the screen. 00:11:29.545 --> 00:11:33.280 This was so core to writing software, particularly programs that run inside 00:11:33.280 --> 00:11:36.630 of that black and white terminal window, that it made sense for printf 00:11:36.630 --> 00:11:39.820 to be embedded into the language's libraries itself. 00:11:39.820 --> 00:11:43.160 >> Now you don't need GetString in order to get strings from users. 00:11:43.160 --> 00:11:45.350 Rather you can use functions like scanf. 00:11:45.350 --> 00:11:48.680 In fact, if unfamiliar, take a look at some of Week 5's walkthroughs where we 00:11:48.680 --> 00:11:51.660 walk through the process of using this function, scanf, to get 00:11:51.660 --> 00:11:52.890 input from the user. 00:11:52.890 --> 00:11:56.310 The problem is that functions like scanf, which are built in to C 00:11:56.310 --> 00:11:59.140 standard libraries, is that they don't do any error checking. 00:11:59.140 --> 00:12:01.540 And they don't actually allocate any memory for strings. 00:12:01.540 --> 00:12:03.340 >> So a couple of bad things can happen-- 00:12:03.340 --> 00:12:06.970 1, you can exceed the boundaries of your array, in which case at best, 00:12:06.970 --> 00:12:07.960 your program might crash. 00:12:07.960 --> 00:12:11.400 But at worst, an adversary might be able to take over your program. 00:12:11.400 --> 00:12:14.020 And you need to manage all of that memory yourself. 00:12:14.020 --> 00:12:16.300 >> So GetString takes away a lot of that complexity. 00:12:16.300 --> 00:12:18.090 So that we allocate memory for you. 00:12:18.090 --> 00:12:20.800 We make sure that you don't go beyond the boundaries of an array. 00:12:20.800 --> 00:12:23.940 And we return null if anything in fact goes wrong. 00:12:23.940 --> 00:12:27.490 So GetString simply adds, at the end of the day, a whole bunch of useful 00:12:27.490 --> 00:12:28.990 error checking. 00:12:28.990 --> 00:12:32.700 >> Now a comment from David in Ohio who claims this-- 00:12:32.700 --> 00:12:35.670 no, you do not need the appliance for all of the projects. 00:12:35.670 --> 00:12:37.120 Now what did he mean by this? 00:12:37.120 --> 00:12:39.930 Well, it turns out that David procured, from an online website, a 00:12:39.930 --> 00:12:44.030 Nokia LCD, like this one here, that's really the size of something you might 00:12:44.030 --> 00:12:45.330 see on an older cellphone. 00:12:45.330 --> 00:12:48.160 And he also procured a Tiva launch board, a piece of hardware that 00:12:48.160 --> 00:12:49.540 connects to this LCD. 00:12:49.540 --> 00:12:50.280 >> Now it's quite small. 00:12:50.280 --> 00:12:52.720 As you can see here is a US quarter for scale. 00:12:52.720 --> 00:12:56.160 And what he did with this is actually implement a program in C. 00:12:56.160 --> 00:12:59.630 >> Indeed, you do not need the CS50 appliance to write programs in C. You 00:12:59.630 --> 00:13:01.140 don't even need a Mac or a PC. 00:13:01.140 --> 00:13:05.090 You can also write and run C code on an embedded device like this. 00:13:05.090 --> 00:13:07.380 Well what did David actually write and run? 00:13:07.380 --> 00:13:08.490 Well check it out. 00:13:08.490 --> 00:13:12.390 He implemented Mario on this tiny little cellphone-like screen from 00:13:12.390 --> 00:13:13.660 Problem Set 1. 00:13:13.660 --> 00:13:16.840 >> So I think I would concur with one of David's classmates who, in the same 00:13:16.840 --> 00:13:19.360 Facebook thread in which David introduced this little program to the 00:13:19.360 --> 00:13:20.970 world, responded with-- 00:13:20.970 --> 00:13:22.670 you are a beast mate. 00:13:22.670 --> 00:13:23.560 Indeed you are. 00:13:23.560 --> 00:13:25.550 >> Now next up is a piece of spam. 00:13:25.550 --> 00:13:28.520 If you're in CS50's Facebook group, you might have noticed some posts like 00:13:28.520 --> 00:13:30.410 this which occasionally slip in there. 00:13:30.410 --> 00:13:32.030 If you do encounter some spam, no big deal. 00:13:32.030 --> 00:13:34.430 Simply report it to us and we'll go ahead and delete it. 00:13:34.430 --> 00:13:37.870 But before we deleted this one we couldn't help take a few screenshots 00:13:37.870 --> 00:13:39.460 and chuckle a bit. 00:13:39.460 --> 00:13:43.850 >> This particular student here-- we'll call him Alan MobilePhone-- 00:13:43.850 --> 00:13:48.760 posted his cell phone number, his BlackBerry chat address, his Skype ID, 00:13:48.760 --> 00:13:51.600 his email address-- none of which you should actually contact. 00:13:51.600 --> 00:13:55.970 But as per the photos here, it seems like Alan MobilePhone has quite a few 00:13:55.970 --> 00:13:59.630 iPhones for sale in what appears to be a fairly nondescript warehouse. 00:13:59.630 --> 00:14:04.160 Now that same David responded to Alan MobilePhone with the following-- 00:14:04.160 --> 00:14:06.220 do they come with gedit installed? 00:14:06.220 --> 00:14:09.220 >> Now normally you think that some spambot would just ignore a reply to 00:14:09.220 --> 00:14:10.120 their original thread. 00:14:10.120 --> 00:14:14.970 But no, Alan MobilePhone had this to say-- all of our phones are brand new, 00:14:14.970 --> 00:14:17.960 come with original box and accessories, all of our phones are SIM 00:14:17.960 --> 00:14:19.490 free, and so forth. 00:14:19.490 --> 00:14:23.170 >> OK, so maybe an automatically generated reply to David the humans 00:14:23.170 --> 00:14:26.290 response, but David pushed a little further-- 00:14:26.290 --> 00:14:30.010 will you install and test the CS50 appliance for us before shipping? 00:14:30.010 --> 00:14:33.450 All right, well let's see what Alan MobilePhone has to say now. 00:14:33.450 --> 00:14:37.330 >> Yes and all of our product is work with SIM cards and networks worldwide. 00:14:37.330 --> 00:14:42.830 Fantastic, now another classmate of ours, Danish, responded with this. 00:14:42.830 --> 00:14:43.730 That would be awesome. 00:14:43.730 --> 00:14:47.810 Take my order as well for two, plus one free, iPhone 5s with the CS50 00:14:47.810 --> 00:14:49.470 appliance preinstalled. 00:14:49.470 --> 00:14:53.390 >> And lastly, Alan MobilePhone said-- yes, all will work. 00:14:53.390 --> 00:14:54.080 Trust me. 00:14:54.080 --> 00:14:57.540 So which of the products would you like to buy from us. 00:14:57.540 --> 00:15:01.890 Sorry Alan MobilePhone, you are now banned. 00:15:01.890 --> 00:15:04.730 >> Chris, now, from Toronto, asked this question of us. 00:15:04.730 --> 00:15:06.580 I have an idea for CS50 Live. 00:15:06.580 --> 00:15:09.750 I think it would be great if David, or some of the other CS50 staff, played 00:15:09.750 --> 00:15:13.180 one or more submitted scratch games for Problem Set 0. 00:15:13.180 --> 00:15:14.730 So this is a great suggestion. 00:15:14.730 --> 00:15:18.670 >> And the thing is, since Problem Set 1 was released on January 1, we've 00:15:18.670 --> 00:15:20.890 actually received thousands of scratch projects. 00:15:20.890 --> 00:15:23.970 So we couldn't possibly do them all justice here and CS50 Live. 00:15:23.970 --> 00:15:26.860 So we thought we'd pluck out one that caught our eye recently known as 00:15:26.860 --> 00:15:27.920 Wizards' Duel. 00:15:27.920 --> 00:15:31.420 >> Wizards' Duel was written by a classmate named Patrick in Ohio. 00:15:31.420 --> 00:15:35.290 And I should caution that this project really went above and beyond what was 00:15:35.290 --> 00:15:36.730 expected in Problem Set 0. 00:15:36.730 --> 00:15:39.580 Don't at all fret if this is not something you can necessarily 00:15:39.580 --> 00:15:43.090 accomplish in your very first time programming, whether with Scratch or 00:15:43.090 --> 00:15:44.130 any other language. 00:15:44.130 --> 00:15:48.420 But we thought it would be fun to play a little bit of Wizards' Duel here. 00:15:48.420 --> 00:15:50.276 >> [MUSIC PLAYING] 00:16:39.370 --> 00:16:43.860 >> Amazing, so if you yourself would like to play or remix Wizards' Duel, Take a 00:16:43.860 --> 00:16:45.350 look at this URL here. 00:16:45.350 --> 00:16:48.130 Go ahead and just pause the video if you would like to type that in. 00:16:48.130 --> 00:16:51.800 >> Well next up is another Scratch project, this one by a student named 00:16:51.800 --> 00:16:54.600 David from Cambridge, Massachusetts. 00:16:54.600 --> 00:16:58.820 So this was actually the very first program I myself wrote back in 2007. 00:16:58.820 --> 00:17:01.410 I was a graduate student at the time and I had cross registered in an 00:17:01.410 --> 00:17:05.099 education course at MIT, taught by Professor Mitchel Resnick. 00:17:05.099 --> 00:17:07.270 At the time, Scratch didn't really exist. 00:17:07.270 --> 00:17:10.510 It was only in beta format, and we-- the students in this class-- had the 00:17:10.510 --> 00:17:14.050 unique opportunity to actually play with, and experiment with Scratch 00:17:14.050 --> 00:17:15.160 before anyone else. 00:17:15.160 --> 00:17:18.400 >> In fact, one of our first assignments in this class was to actually make our 00:17:18.400 --> 00:17:19.420 own Scratch project. 00:17:19.420 --> 00:17:23.069 And to this day I remember spending some eight hours on a Friday night of 00:17:23.069 --> 00:17:25.589 all things working on Oscartime here. 00:17:25.589 --> 00:17:28.550 And now those of you familiar with Oscar the Grouch from Sesame Street 00:17:28.550 --> 00:17:31.700 might in a moment recall the song that's about to be played. 00:17:31.700 --> 00:17:34.760 >> And I used to have very, very fond memories of the song. 00:17:34.760 --> 00:17:38.340 But trust me, after eight hours of listening to something on the loop, 00:17:38.340 --> 00:17:43.730 with a forever type loop, it very quickly sours a bit of that memory. 00:17:43.730 --> 00:17:45.870 But for you, you get just one glimpse at this. 00:17:45.870 --> 00:17:49.252 And I give you this example of Oscartime. 00:17:49.252 --> 00:17:53.190 >> [MUSIC PLAYING] 00:17:53.190 --> 00:17:56.940 >> SPEAKER 4: (SINGING) Oh I love trash-- 00:17:56.940 --> 00:18:05.200 anything dirty or dingy or dusty, anything ragged or rotten or rusty. 00:18:05.200 --> 00:18:08.668 Yes I love trash. 00:18:08.668 --> 00:18:10.980 Here's some more rotten stuff. 00:18:10.980 --> 00:18:20.012 Yes, I love, I love, I love trash. 00:18:23.790 --> 00:18:26.940 >> SPEAKER 1: Now if you'd like to play or remix Oscartime, and improve upon 00:18:26.940 --> 00:18:29.500 it, go to this URL here. 00:18:29.500 --> 00:18:31.290 Well, next is a question from [? Bosco ?] 00:18:31.290 --> 00:18:34.750 in Hong Kong, who wrote this-- what is the programming language 00:18:34.750 --> 00:18:36.340 behind MIT's Scratch? 00:18:36.340 --> 00:18:37.330 So that's a great question. 00:18:37.330 --> 00:18:40.640 >> But rather than answer that ourselves, we decided to take our cameras down 00:18:40.640 --> 00:18:44.790 the road to MIT's Media Lab, where the Lifelong Kindergarten group is, led by 00:18:44.790 --> 00:18:47.610 Professor Mitchel Resnick, from whom I took that class years ago. 00:18:47.610 --> 00:18:50.250 We met not only with Professor Resnick, but also the John Maloney, 00:18:50.250 --> 00:18:52.730 the original author of the Scratch program. 00:18:52.730 --> 00:18:56.050 So the very software you have been using to create other software was 00:18:56.050 --> 00:18:58.090 written primarily by John. 00:18:58.090 --> 00:19:02.020 Pictured here in fact is John, myself, and Mitchell standing behind a real 00:19:02.020 --> 00:19:05.750 world incarnation of Scratch shortly after our conversation. 00:19:05.750 --> 00:19:10.278 But before we take a listen, sixty seconds here of puppies. 00:19:10.278 --> 00:20:11.860 >> [MUSIC - JOHN MAYER, "WILDFIRE"] 00:20:11.860 --> 00:20:16.190 >> Scratch actually in all sincerity holds a special place in our heart 00:20:16.190 --> 00:20:16.990 here at CS50. 00:20:16.990 --> 00:20:20.020 Indeed, we introduced Scratch into the course in 2007. 00:20:20.020 --> 00:20:22.090 And what was striking that year was the following. 00:20:22.090 --> 00:20:26.130 Whereas in years prior, say 2006, we would have some 200 students shop the 00:20:26.130 --> 00:20:29.250 course, which in Harvard speak means to drop by the course in the first 00:20:29.250 --> 00:20:33.120 weeks of the semester, but not necessarily take the class. 00:20:33.120 --> 00:20:36.350 67% of those students would typically remain and come back in 00:20:36.350 --> 00:20:37.440 the weeks that follow. 00:20:37.440 --> 00:20:40.320 >> Meanwhile in 2007, when we introduced Scratch as well as some other 00:20:40.320 --> 00:20:44.680 curricular tweaks, we jumped up to a 97% retention ratio of those students 00:20:44.680 --> 00:20:46.200 who were shopping CS50. 00:20:46.200 --> 00:20:49.960 And so ever since then Scratch has been a core part of CS50, albeit just 00:20:49.960 --> 00:20:50.890 in that first week. 00:20:50.890 --> 00:20:54.420 But I dare say it sets the tone of the course, and really speaks to our goal 00:20:54.420 --> 00:20:58.840 in CS50 of making computer science all the more accessible. 00:20:58.840 --> 00:21:02.530 With that said, our thanks to Mitchell and John and the whole Scratch team. 00:21:02.530 --> 00:21:05.710 Let's now take that field trip down the road. 00:21:05.710 --> 00:21:06.930 >> MITCHEL RESNICK: Hi, I'm Mitch Resnick. 00:21:06.930 --> 00:21:09.970 I'm a professor of Learning Research here at the MIT Media Lab. 00:21:09.970 --> 00:21:12.590 And I also direct MIT Scratch team. 00:21:12.590 --> 00:21:15.810 >> JOHN MALONEY: I'm John Maloney, and I was a researcher for about eleven 00:21:15.810 --> 00:21:19.240 years, working on a Scratch project as the lead developer. 00:21:19.240 --> 00:21:22.460 >> MITCHEL RESNICK: We call our research group the Lifelong Kindergarten group 00:21:22.460 --> 00:21:24.785 because we're inspired by the way children learn in kindergarten. 00:21:24.785 --> 00:21:28.820 In the classic kindergarten, children are playfully designing and creating 00:21:28.820 --> 00:21:30.920 things in collaboration with one another-- 00:21:30.920 --> 00:21:33.300 building towers with wooden blocks, making pictures with 00:21:33.300 --> 00:21:34.720 finger paints and crayons. 00:21:34.720 --> 00:21:38.430 As we developed Scratch, we wanted to capture that kindergarten spirit for 00:21:38.430 --> 00:21:39.700 learners of all ages. 00:21:39.700 --> 00:21:42.880 >> JOHN MALONEY: One of the big motivations for Scratch was this 00:21:42.880 --> 00:21:47.930 project that Mitchel and Natalie had started called the Computer Clubhouse. 00:21:47.930 --> 00:21:54.570 And they saw a lot of kids doing stuff with media tools like Photoshop and 00:21:54.570 --> 00:21:58.700 various sound production tools, but they weren't doing any programming. 00:21:58.700 --> 00:22:00.020 The kids weren't doing any programming. 00:22:00.020 --> 00:22:02.440 And we looked around and said-- well, why aren't they doing it? 00:22:02.440 --> 00:22:06.380 And the answer seemed to be that there wasn't a tool that was appropriate for 00:22:06.380 --> 00:22:07.220 that setting. 00:22:07.220 --> 00:22:10.960 >> MITCHEL RESNICK: As we were developing Scratch, I was inspired by some of the 00:22:10.960 --> 00:22:13.660 ideas of my mentor Seymour Papert, who developed the 00:22:13.660 --> 00:22:15.640 logo programming language. 00:22:15.640 --> 00:22:19.535 Seymour always used to say that it was important for a new technology to have 00:22:19.535 --> 00:22:24.140 a low floor, meaning it's easy to get started with, a high ceiling, mean you 00:22:24.140 --> 00:22:25.980 can do more and more complex things with it. 00:22:25.980 --> 00:22:30.480 >> We also wanted to have what we call wide walls, meaning there are many 00:22:30.480 --> 00:22:31.100 different pathways. 00:22:31.100 --> 00:22:34.800 That you can do many different things with the software. 00:22:34.800 --> 00:22:38.320 It's not enough just to get started easily and do complex things if 00:22:38.320 --> 00:22:39.900 everyone's doing the same thing. 00:22:39.900 --> 00:22:42.690 We wanted to have many different pathways, because we know different 00:22:42.690 --> 00:22:45.760 people have different interests, and we wanted everyone to be able to work 00:22:45.760 --> 00:22:48.090 on projects that grew out of their own interests. 00:22:48.090 --> 00:22:52.020 >> JOHN MALONEY: I'd like to say that we considered about ten times more 00:22:52.020 --> 00:22:55.730 commands and features than have ever ended up in Scratch. 00:22:55.730 --> 00:23:01.160 We would have endless debates about exactly what wording to put on blocks, 00:23:01.160 --> 00:23:05.650 and things like whether the default direction of the sprite should be up 00:23:05.650 --> 00:23:06.570 or to the right. 00:23:06.570 --> 00:23:10.450 So we thought about all of these things, especially the very early 00:23:10.450 --> 00:23:13.790 experiences that people would have with Scratch, and trying to make it so 00:23:13.790 --> 00:23:16.800 that things could be discovered just by experimentation. 00:23:16.800 --> 00:23:20.370 >> MITCHEL RESNICK: When we were first designing Scratch our target audience 00:23:20.370 --> 00:23:22.670 was ages eight to sixteen. 00:23:22.670 --> 00:23:26.400 >> JOHN MALONEY: On the low end of the spectrum, we found that much younger 00:23:26.400 --> 00:23:28.940 kids were using Scratch than we ever anticipated. 00:23:28.940 --> 00:23:33.410 I still remember the first Scratch day, I think, that we had. 00:23:33.410 --> 00:23:36.340 This little six-year-old guy came in. 00:23:36.340 --> 00:23:41.540 On the upper end, I've been surprised at, for example, the use of Scratch in 00:23:41.540 --> 00:23:43.660 college classes like CS50. 00:23:43.660 --> 00:23:47.750 Because we didn't really think of Scratch as a language for teaching 00:23:47.750 --> 00:23:50.070 computer science to computer scientists. 00:23:50.070 --> 00:23:52.970 >> Another surprise is how many adults are using it. 00:23:52.970 --> 00:23:58.830 We found that people who are like full time programmers enjoy programming in 00:23:58.830 --> 00:24:00.530 Scratch as a sort of a hobby. 00:24:00.530 --> 00:24:03.860 And so we've seen people on the Scratch website create projects that 00:24:03.860 --> 00:24:05.470 do, for example-- 00:24:05.470 --> 00:24:08.380 ray tracing 3D rendering systems. 00:24:08.380 --> 00:24:10.120 I couldn't believe it when I saw that. 00:24:10.120 --> 00:24:13.170 >> MITCHEL RESNICK: As we started to work on Scratch, we wanted to make it 00:24:13.170 --> 00:24:16.360 different from previous programming languages in order to make it 00:24:16.360 --> 00:24:19.010 accessible to a much wider range of people. 00:24:19.010 --> 00:24:21.770 So we had three core guiding principles. 00:24:21.770 --> 00:24:24.880 First we wanted to make it more tinkerable, so you could build up 00:24:24.880 --> 00:24:27.810 programs much like putting LEGO bricks together. 00:24:27.810 --> 00:24:30.760 So we had the visual programming block that's not together. 00:24:30.760 --> 00:24:34.670 >> Second of all, we wanted to let people work on more meaningful projects, 00:24:34.670 --> 00:24:37.060 things that were personally relevant for them. 00:24:37.060 --> 00:24:38.890 That's why we make Scratch so media rich. 00:24:38.890 --> 00:24:41.230 >> Third of all, we wanted to make it more social. 00:24:41.230 --> 00:24:43.580 Because a lot of the best learning experiences come when we 00:24:43.580 --> 00:24:45.220 interact with others. 00:24:45.220 --> 00:24:48.590 So we added the Scratch online community from the very beginning, 00:24:48.590 --> 00:24:51.790 right when we launched the software, so that people would have an audience 00:24:51.790 --> 00:24:55.460 for their creations, and also get inspired by what other people created. 00:24:55.460 --> 00:24:59.720 Since we launched scratch there have been around 4.5 million projects that 00:24:59.720 --> 00:25:01.760 have been shared on the Scratch website. 00:25:01.760 --> 00:25:05.610 >> JOHN MALONEY: So I actually joined the project by sort 00:25:05.610 --> 00:25:07.770 of pleading to Mitchel. 00:25:07.770 --> 00:25:10.510 I asked to joined when I heard about it, because I thought it was going to 00:25:10.510 --> 00:25:12.790 be such a cool thing and I wanted to help. 00:25:12.790 --> 00:25:17.010 But my favorite language was Smalltalk, and I had helped develop 00:25:17.010 --> 00:25:19.430 this version of Smalltalk called Squeak. 00:25:19.430 --> 00:25:23.240 >> So I said, well, I'll come and do this work as long as I 00:25:23.240 --> 00:25:24.960 can build it in Squeak. 00:25:24.960 --> 00:25:27.920 And Mitchel said-- oh sure, I don't care what it's made in. 00:25:27.920 --> 00:25:28.920 Just make it work. 00:25:28.920 --> 00:25:31.950 And so that's how it got to be written in Squeak. 00:25:31.950 --> 00:25:36.730 >> So with Scratch 2.0 we thought that we would try to make Scratch reach out to 00:25:36.730 --> 00:25:39.750 more people by making it a Cloud based app. 00:25:39.750 --> 00:25:43.290 And, although there was a version of Squeak that ran in the browser, it 00:25:43.290 --> 00:25:45.960 required downloading and installing a plug-in. 00:25:45.960 --> 00:25:49.450 And we knew that a lot of people would have trouble doing that, either 00:25:49.450 --> 00:25:54.310 because it was a complicated process or because their administration at 00:25:54.310 --> 00:25:56.470 their school, or whatever, wouldn't allow it. 00:25:56.470 --> 00:26:00.310 So we wanted something that was kind of built into the browsers, or was 00:26:00.310 --> 00:26:03.050 kind of by default there on most browsers. 00:26:03.050 --> 00:26:07.100 We considered Java, we considered Silverlight, we considered JavaScript, 00:26:07.100 --> 00:26:08.590 and we considered Flash. 00:26:08.590 --> 00:26:11.020 >> At that point Flash was really on the ascendancy. 00:26:11.020 --> 00:26:12.350 Adobe was really pushing it. 00:26:12.350 --> 00:26:17.420 And we didn't yet know that it was going to be such a problem on iOS, and 00:26:17.420 --> 00:26:19.200 mobile devices, and so forth. 00:26:19.200 --> 00:26:20.480 So we went with Flash. 00:26:20.480 --> 00:26:25.690 >> And in retrospect it would've maybe been nicer if we'd gone with 00:26:25.690 --> 00:26:27.900 JavaScript because that's become the dominant language. 00:26:27.900 --> 00:26:31.690 But I don't think there's any way we could possibly have seen all the 00:26:31.690 --> 00:26:33.690 things that were going to change between then and now. 00:26:33.690 --> 00:26:37.620 And it takes three years or so to put together something like this. 00:26:37.620 --> 00:26:40.860 So you make your best guess and hope for the best. 00:26:40.860 --> 00:26:44.720 >> MITCHEL RESNICK: One new projects is called Scratch Junior, trying to have 00:26:44.720 --> 00:26:47.130 Scratch go down to even younger kids. 00:26:47.130 --> 00:26:49.810 It's being aimed at age five to seven year olds, like 00:26:49.810 --> 00:26:51.780 kindergarten to second grade. 00:26:51.780 --> 00:26:53.610 The first version of it will be on the iPad. 00:26:53.610 --> 00:26:57.130 And we plan to have it come out in the middle of 2014. 00:26:57.130 --> 00:26:59.660 So Scratch Junior will be a somewhat scaled down version. 00:26:59.660 --> 00:27:02.540 It will have somewhat fewer features, and also make things more 00:27:02.540 --> 00:27:05.450 developmentally appropriate for younger kids. 00:27:05.450 --> 00:27:09.580 >> JOHN MALONEY: I enjoy the fact that Scratch 2.0, especially, is sort of 00:27:09.580 --> 00:27:14.070 secretly higher performance than you might imagine. 00:27:14.070 --> 00:27:16.410 By default, when you're doing animations and so forth, you're 00:27:16.410 --> 00:27:20.730 limited to the update rate of the screen. 00:27:20.730 --> 00:27:24.610 And we designed it deliberately so that it only does a little bit per 00:27:24.610 --> 00:27:30.330 frame, so that if you say repeat 10, move 10, you actually see it move in 00:27:30.330 --> 00:27:32.450 ten little increments. 00:27:32.450 --> 00:27:36.590 >> However, there's a sort of hidden mode called turbo mode, which you can get 00:27:36.590 --> 00:27:38.920 by shift clicking on the green flag. 00:27:38.920 --> 00:27:42.670 And that basically lets it run kind of as fast as it can. 00:27:42.670 --> 00:27:46.210 So this is what lets you do things like the ray tracer, and you don't 00:27:46.210 --> 00:27:49.480 have to-- the original ray tracer, you had to wait like about half an hour to 00:27:49.480 --> 00:27:52.020 see the results, because it was kind of chugging through 00:27:52.020 --> 00:27:53.060 one frame at a time. 00:27:53.060 --> 00:27:57.240 But, with the shift click thing, you can get the results in something like 00:27:57.240 --> 00:27:58.980 twenty seconds. 00:27:58.980 --> 00:28:03.610 So all of a sudden you can just sort of high level things in Scratch, but 00:28:03.610 --> 00:28:05.990 it's a hidden feature. 00:28:05.990 --> 00:28:08.470 >> SPEAKER 1: Thank you so much to Mitchel and John for everything 00:28:08.470 --> 00:28:09.890 they've done for CS50. 00:28:09.890 --> 00:28:13.190 Thanks to Andrew, Al, and Shelley, who are behind the cameras this week. 00:28:13.190 --> 00:28:15.460 And thanks so much to all of the students, those of you out there who 00:28:15.460 --> 00:28:16.290 submitted content. 00:28:16.290 --> 00:28:22.340 >> And indeed, if you would like to contribute content for a future week, 00:28:22.340 --> 00:28:26.420 do reach out to us via Facebook, Reddit, Twitter, or any of the other 00:28:26.420 --> 00:28:27.570 course's means. 00:28:27.570 --> 00:28:29.750 That's it for CS50 Live. 00:28:29.750 --> 00:28:32.480 This was CS50. 00:28:32.480 --> 00:28:33.730 Damn it.