SPEAKER 1: Hello world, this is CS50 Live. We'd like to begin this time with a shout out to our friends in St. Louis, Missouri, where a group of volunteers known as LaunchCode have been gathering together CS50x students in order to take the class collectively. And the goal ultimately is that, after the semester's end, is to pair those students with a local tech jobs. Now originally the LaunchCode folks, and the students involved, were going to convene in a local library where a few hundred people had RSVPed. But so many people ended up RSVPing in the end for this initiative, that they ended up moving to a local opera house, depicted here. Now it's a little small. But if you look ever so closely you can see up on stage that first slide from Week 0 that speaks to the fact that 73% of your classmates, perhaps including you, have no prior experience. And indeed that was very much the case in this opera house here. So our hellos to the folks at LaunchCode and the citizens of St. Louis. If you yourself live local to Saint Louis, do feel free to check them out at launchcodestl.com. Or, perhaps, turn on your local news channel as we'll do here for you. SPEAKER 2: An amazing opportunity for any Saint Louisan looking to land one of those high tech, high paying jobs. For the first time ever, the same computer programming class that's taught online by Harvard and MIT is being offered in person at the St. Louis Public Library. It is all thanks to the organization LaunchCode, which is trying to solve the tech talent gap here in St. Louis. Now anyone who passes this four month course is likely to get a paid apprenticeship that could turn into a computer programming job. LaunchCode's co-founder says, if you learn this skill set, in today's market you are almost guaranteed to land a six figure job in a couple of years, with a starting salary around $50,000. That sounds pretty good. So what kind of person should consider taking this class? JIM MCKELVEY: You have to be pretty smart, OK? You have to be extremely hard working. But you don't have to have gone to the best schools. You don't have to be great at math. You don't have to have some of the things that you may believe you need. And this course will tell you if you've got it. SPEAKER 2: Wow, now, if you are wondering if there are enough programming jobs available in St. Louis, the answer is a big yes. McKelvey says there are more than 1,000 open positions and just not enough local people trying to fill them. Now this class starts Monday at 5:30 at the Central Branch at the St. Louis Public Library. If you're interested, and I'm sure some of you will be, the information that ksdk.com. SPEAKER 1: Some of your classmates would now like to say hello. Up first is Suzanne, from Winthrop, Massachusetts, a nearby town just down the road from here. SUZANNE: Hello world, I'm Suzanne. I live in Winthrop, Massachusetts, United States, on the water. And I am 63 years old. I'm a retired nurse. I have four children and two grandchildren. I'm also a theater director and an actress. And sometime this year I'll be appearing in Discovery Channel's "The Boston Strangler." I play Zenovia Clegg. I'm taking CS50 because I love edX. I've taken two previous courses. I've taken Justice, and Public Health and Environmental Change. And I loved them. Also because computer science scares me a little. And in my age bracket we're encouraged to do things that frighten us. So I'm taking CS50 and looking forward to it. So my name is Suzanne, and this is CS50. SPEAKER 1: Up next are several hellos from some of your classmates in Brewer High School in Maine. Let's take a listen. BREWER HIGH SCHOOL STUDENTS: Hello world, we're Brewer High. PATRICK: Hi, I'm Patrick. ADAM: I'm Adam. NIKOLAI: I'm Nikolai. BEN: I'm Ben. DYLAN: I'm Dylan. NICK: I'm Nick. CHRISTINA: I'm Christina. JONATHAN: I'm Jonathan. CHARLES: I'm Charles. BREWER HIGH SCHOOL STUDENTS: And this is CS50. SPEAKER 1: Hello Brewer High School-- and now Stuart and a friend of his, from the nearby state of Virginia. STUART: Hello world, my name is Stuart. And I'm from Virginia. And this is my first time doing a Harvard course or any online course like that. I really like computers and want to learn more about them. I'm Stuart, and this is CS50. SPEAKER 1: Hello Stuart. So we've also been keeping an eye on Twitter, where one of your classmates, Umberto from Mexico, had this to tweet recently. Hey, @davidjmalan, let me ask you a question-- Mark Zuckerberg took CS50? So, sadly, Mark did not in fact take CS50 upon enrolling as a freshman here at Harvard. Rather he skipped ahead to a more advanced class known as CS51, which covers computer science topics like abstraction, and programming concepts like functional programming an object oriented programming. Now at the time it was taught by a professor named Henry Leitner, who actually taught the course when I took it as well. Our own preceptor, Rob Bowden, recently sat down with Professor Latiner to talk about a few of his former students besides me. ROB BOWDEN: Hi, I'm Rob Bowden, and I'm here with Dr. Henry Leitner, who's the Associate Dean of Information Technology at DCE, and Senior Lecturer in Computer Science. All right, so I've have heard that you've had some celebrities pass through some of your courses. HENRY LEITNER: All right, so I like to tell my students I've been at Harvard a long time. And when they say-- well how long have you been here?-- my answer is I'm old enough to have worked on homework assignments with that billionaire dropout Bill Gates. But I'm also young enough to have actually taught that billionaire dropout Mark Zuckerberg, of Facebook fame. So my encounter with Bill Gates goes way back to the beginning in the 1974, 1975 academic year. The story is true that Bill Gates' friend Paul Allen went to news stand in Harvard Square and came upon in Popular Electronics Magazine, which was featuring a story about the world's first personal computer, which you had to actually build-- assemble from parts-- the Altair. He came running back to Bill Gates' dormitory. And they got all excited that the personal computer revolution was about to start without them. So at the time, Gates and I-- we were working on problems. That's because we were both enrolled in a theory of computation course, a very mathy graduate level course. And on the first day of class the professor told everyone in the room to turn to their neighbor and introduce themselves, and then collaborate with that person on problem sets. So Gates and I-- I didn't know who he was at the time. He was maybe sixteen or seventeen, but he looked like he was twelve, to be honest. And we started to work on homeworks together. But then when the Altair came out in Popular Electronics Magazine, caught his attention. He just disappeared. He stopped doing the homework. I got angry at him. And I would just watch him in the one computing lab we had at Harvard for research at the time, which was called the Aiken Computation Lab. A PDP-10 was being used. And he was hacking away day and night, basically just living there. As I found out later, he was actually designing software for the original Altair, an operating system, along with the programming language BASIC that was going to run. The idea being that for a personal computer industry to take off you would need to be able to write software. And writing programs and machine language by flipping toggle switches was not going to make it, except beyond the hobbyists. What was interesting at the time was the Altair was so popular you couldn't even buy one, certainly after it was announced. So Bill Gates, amazingly, with his friend Paul Allen, wrote a program on the PDP-10 that simulated the behavior of this Altair, because the specs were fully written up in the Popular Electronics Magazine. So, as I said, I got angry at him, I didn't pay attention. He disappeared, went off to Albuquerque, New Mexico, to show off what he had done to the folks who had built the Altair. And at the times, leaving college-- leaving Harvard-- to start a company was unheard of. And so when I found out that's what had happened I was done. Because I kept thinking about-- my parents would have killed me if I had dropped out of school just to go off and start a company. And then of course there's Mark Zuckerberg. I got to know him partly because he came after finishing CS51. I guess it was after [INAUDIBLE] had completed the course. He wanted to work as a teaching fellow in the subsequent year for CS51. And he came to the interview. And the truth of the matter is his performance was somewhat weak compared to the other folks who had interviewed. It was actually the weakest of the bunch. So I didn't feel as though I could in good conscience hire him. Plus, he was in a bit of trouble with the administrative board. If you saw the movie, The Social Network. OK, so much of it is factually true. At the time he had just finished doing the Facemash, not Facebook but the Facemash app. And he had brought down the Harvard network inadvertently. And plus he had stolen the faces of Harvard college undergraduate women to do this project. So he was brought to the administrative board. He was slapped on the hands. So he was in some trouble. And I think he was sort of disconcerted by that. So I like to tell people that I take a tiny, tiny bit of credit for the success of Facebook because-- A, at least one half or 1% of Zuckerberg's programming skill came from my course-- what he learned there. And secondly, had I hired him as a teaching fellow, he would not have had the time to complete Facebook at the point that he did. So it has been a lot of fun teaching computer science at Harvard. I mean there are just amazing people who go on to do great things. I could go on and tell you about other folks, but I think our time is up. ROB BOWDEN: So it sounds like Bill Gates owes you some money for causing all that stress in Theory of Computation. And Mark Zuckerberg owes you some money for letting him start Facebook. HENRY LEITNER: That's a nice way to think about, sure. ROB BOWDEN: All right, well thanks. This has been great. Thanks for having me. Shake his hand maybe. Should I shake his hand? Should we redo the ending? How should we do the ending? SPEAKER 1: Next, a question from [? Sin, ?] one of your classmates in Vietnam who had this to say. How do I contact other people in my country? Well this too is a great question. And if you log into the edX interface, for CS50x's main info page, you'll see a link to CS50 meetups, which will lead you to meetup.com/meet50, which is a tool that we've set up to allow you to find people who are local to you so that you can actually meet up, not only virtually with classmates this year, but in person as well. In fact, when you visit this URL, you'll see a map that looks like this, where every marker represents one or more of your classmates in that part of the world. Indeed right now, some of the most popular communities of CS50x students are in New York, London, Delhi, Cairo, and San Francisco, and over 199 other cities as well. So if interested in meeting up with some classmates locally, do head to meet meetup.com/meet50. A question now from Scott in New York, who had this question to write-- most every program uses strings, so why was printf included in the standard I/O library, and GetString was not? Is GetString a function defined in the CS50 library? So yes indeed, GetString is indeed defined in CS50's library. And printf, meanwhile, is in the standard I/O library. Now back in the day, when C was invented, surely it was important, a fundamental functionality for code like printf to actually print something to the screen. This was so core to writing software, particularly programs that run inside of that black and white terminal window, that it made sense for printf to be embedded into the language's libraries itself. Now you don't need GetString in order to get strings from users. Rather you can use functions like scanf. In fact, if unfamiliar, take a look at some of Week 5's walkthroughs where we walk through the process of using this function, scanf, to get input from the user. The problem is that functions like scanf, which are built in to C standard libraries, is that they don't do any error checking. And they don't actually allocate any memory for strings. So a couple of bad things can happen-- 1, you can exceed the boundaries of your array, in which case at best, your program might crash. But at worst, an adversary might be able to take over your program. And you need to manage all of that memory yourself. So GetString takes away a lot of that complexity. So that we allocate memory for you. We make sure that you don't go beyond the boundaries of an array. And we return null if anything in fact goes wrong. So GetString simply adds, at the end of the day, a whole bunch of useful error checking. Now a comment from David in Ohio who claims this-- no, you do not need the appliance for all of the projects. Now what did he mean by this? Well, it turns out that David procured, from an online website, a Nokia LCD, like this one here, that's really the size of something you might see on an older cellphone. And he also procured a Tiva launch board, a piece of hardware that connects to this LCD. Now it's quite small. As you can see here is a US quarter for scale. And what he did with this is actually implement a program in C. Indeed, you do not need the CS50 appliance to write programs in C. You don't even need a Mac or a PC. You can also write and run C code on an embedded device like this. Well what did David actually write and run? Well check it out. He implemented Mario on this tiny little cellphone-like screen from Problem Set 1. So I think I would concur with one of David's classmates who, in the same Facebook thread in which David introduced this little program to the world, responded with-- you are a beast mate. Indeed you are. Now next up is a piece of spam. If you're in CS50's Facebook group, you might have noticed some posts like this which occasionally slip in there. If you do encounter some spam, no big deal. Simply report it to us and we'll go ahead and delete it. But before we deleted this one we couldn't help take a few screenshots and chuckle a bit. This particular student here-- we'll call him Alan MobilePhone-- posted his cell phone number, his BlackBerry chat address, his Skype ID, his email address-- none of which you should actually contact. But as per the photos here, it seems like Alan MobilePhone has quite a few iPhones for sale in what appears to be a fairly nondescript warehouse. Now that same David responded to Alan MobilePhone with the following-- do they come with gedit installed? Now normally you think that some spambot would just ignore a reply to their original thread. But no, Alan MobilePhone had this to say-- all of our phones are brand new, come with original box and accessories, all of our phones are SIM free, and so forth. OK, so maybe an automatically generated reply to David the humans response, but David pushed a little further-- will you install and test the CS50 appliance for us before shipping? All right, well let's see what Alan MobilePhone has to say now. Yes and all of our product is work with SIM cards and networks worldwide. Fantastic, now another classmate of ours, Danish, responded with this. That would be awesome. Take my order as well for two, plus one free, iPhone 5s with the CS50 appliance preinstalled. And lastly, Alan MobilePhone said-- yes, all will work. Trust me. So which of the products would you like to buy from us. Sorry Alan MobilePhone, you are now banned. Chris, now, from Toronto, asked this question of us. I have an idea for CS50 Live. I think it would be great if David, or some of the other CS50 staff, played one or more submitted scratch games for Problem Set 0. So this is a great suggestion. And the thing is, since Problem Set 1 was released on January 1, we've actually received thousands of scratch projects. So we couldn't possibly do them all justice here and CS50 Live. So we thought we'd pluck out one that caught our eye recently known as Wizards' Duel. Wizards' Duel was written by a classmate named Patrick in Ohio. And I should caution that this project really went above and beyond what was expected in Problem Set 0. Don't at all fret if this is not something you can necessarily accomplish in your very first time programming, whether with Scratch or any other language. But we thought it would be fun to play a little bit of Wizards' Duel here. [MUSIC PLAYING] Amazing, so if you yourself would like to play or remix Wizards' Duel, Take a look at this URL here. Go ahead and just pause the video if you would like to type that in. Well next up is another Scratch project, this one by a student named David from Cambridge, Massachusetts. So this was actually the very first program I myself wrote back in 2007. I was a graduate student at the time and I had cross registered in an education course at MIT, taught by Professor Mitchel Resnick. At the time, Scratch didn't really exist. It was only in beta format, and we-- the students in this class-- had the unique opportunity to actually play with, and experiment with Scratch before anyone else. In fact, one of our first assignments in this class was to actually make our own Scratch project. And to this day I remember spending some eight hours on a Friday night of all things working on Oscartime here. And now those of you familiar with Oscar the Grouch from Sesame Street might in a moment recall the song that's about to be played. And I used to have very, very fond memories of the song. But trust me, after eight hours of listening to something on the loop, with a forever type loop, it very quickly sours a bit of that memory. But for you, you get just one glimpse at this. And I give you this example of Oscartime. [MUSIC PLAYING] SPEAKER 4: (SINGING) Oh I love trash-- anything dirty or dingy or dusty, anything ragged or rotten or rusty. Yes I love trash. Here's some more rotten stuff. Yes, I love, I love, I love trash. SPEAKER 1: Now if you'd like to play or remix Oscartime, and improve upon it, go to this URL here. Well, next is a question from [? Bosco ?] in Hong Kong, who wrote this-- what is the programming language behind MIT's Scratch? So that's a great question. But rather than answer that ourselves, we decided to take our cameras down the road to MIT's Media Lab, where the Lifelong Kindergarten group is, led by Professor Mitchel Resnick, from whom I took that class years ago. We met not only with Professor Resnick, but also the John Maloney, the original author of the Scratch program. So the very software you have been using to create other software was written primarily by John. Pictured here in fact is John, myself, and Mitchell standing behind a real world incarnation of Scratch shortly after our conversation. But before we take a listen, sixty seconds here of puppies. [MUSIC - JOHN MAYER, "WILDFIRE"] Scratch actually in all sincerity holds a special place in our heart here at CS50. Indeed, we introduced Scratch into the course in 2007. And what was striking that year was the following. Whereas in years prior, say 2006, we would have some 200 students shop the course, which in Harvard speak means to drop by the course in the first weeks of the semester, but not necessarily take the class. 67% of those students would typically remain and come back in the weeks that follow. Meanwhile in 2007, when we introduced Scratch as well as some other curricular tweaks, we jumped up to a 97% retention ratio of those students who were shopping CS50. And so ever since then Scratch has been a core part of CS50, albeit just in that first week. But I dare say it sets the tone of the course, and really speaks to our goal in CS50 of making computer science all the more accessible. With that said, our thanks to Mitchell and John and the whole Scratch team. Let's now take that field trip down the road. MITCHEL RESNICK: Hi, I'm Mitch Resnick. I'm a professor of Learning Research here at the MIT Media Lab. And I also direct MIT Scratch team. JOHN MALONEY: I'm John Maloney, and I was a researcher for about eleven years, working on a Scratch project as the lead developer. MITCHEL RESNICK: We call our research group the Lifelong Kindergarten group because we're inspired by the way children learn in kindergarten. In the classic kindergarten, children are playfully designing and creating things in collaboration with one another-- building towers with wooden blocks, making pictures with finger paints and crayons. As we developed Scratch, we wanted to capture that kindergarten spirit for learners of all ages. JOHN MALONEY: One of the big motivations for Scratch was this project that Mitchel and Natalie had started called the Computer Clubhouse. And they saw a lot of kids doing stuff with media tools like Photoshop and various sound production tools, but they weren't doing any programming. The kids weren't doing any programming. And we looked around and said-- well, why aren't they doing it? And the answer seemed to be that there wasn't a tool that was appropriate for that setting. MITCHEL RESNICK: As we were developing Scratch, I was inspired by some of the ideas of my mentor Seymour Papert, who developed the logo programming language. Seymour always used to say that it was important for a new technology to have a low floor, meaning it's easy to get started with, a high ceiling, mean you can do more and more complex things with it. We also wanted to have what we call wide walls, meaning there are many different pathways. That you can do many different things with the software. It's not enough just to get started easily and do complex things if everyone's doing the same thing. We wanted to have many different pathways, because we know different people have different interests, and we wanted everyone to be able to work on projects that grew out of their own interests. JOHN MALONEY: I'd like to say that we considered about ten times more commands and features than have ever ended up in Scratch. We would have endless debates about exactly what wording to put on blocks, and things like whether the default direction of the sprite should be up or to the right. So we thought about all of these things, especially the very early experiences that people would have with Scratch, and trying to make it so that things could be discovered just by experimentation. MITCHEL RESNICK: When we were first designing Scratch our target audience was ages eight to sixteen. JOHN MALONEY: On the low end of the spectrum, we found that much younger kids were using Scratch than we ever anticipated. I still remember the first Scratch day, I think, that we had. This little six-year-old guy came in. On the upper end, I've been surprised at, for example, the use of Scratch in college classes like CS50. Because we didn't really think of Scratch as a language for teaching computer science to computer scientists. Another surprise is how many adults are using it. We found that people who are like full time programmers enjoy programming in Scratch as a sort of a hobby. And so we've seen people on the Scratch website create projects that do, for example-- ray tracing 3D rendering systems. I couldn't believe it when I saw that. MITCHEL RESNICK: As we started to work on Scratch, we wanted to make it different from previous programming languages in order to make it accessible to a much wider range of people. So we had three core guiding principles. First we wanted to make it more tinkerable, so you could build up programs much like putting LEGO bricks together. So we had the visual programming block that's not together. Second of all, we wanted to let people work on more meaningful projects, things that were personally relevant for them. That's why we make Scratch so media rich. Third of all, we wanted to make it more social. Because a lot of the best learning experiences come when we interact with others. So we added the Scratch online community from the very beginning, right when we launched the software, so that people would have an audience for their creations, and also get inspired by what other people created. Since we launched scratch there have been around 4.5 million projects that have been shared on the Scratch website. JOHN MALONEY: So I actually joined the project by sort of pleading to Mitchel. I asked to joined when I heard about it, because I thought it was going to be such a cool thing and I wanted to help. But my favorite language was Smalltalk, and I had helped develop this version of Smalltalk called Squeak. So I said, well, I'll come and do this work as long as I can build it in Squeak. And Mitchel said-- oh sure, I don't care what it's made in. Just make it work. And so that's how it got to be written in Squeak. So with Scratch 2.0 we thought that we would try to make Scratch reach out to more people by making it a Cloud based app. And, although there was a version of Squeak that ran in the browser, it required downloading and installing a plug-in. And we knew that a lot of people would have trouble doing that, either because it was a complicated process or because their administration at their school, or whatever, wouldn't allow it. So we wanted something that was kind of built into the browsers, or was kind of by default there on most browsers. We considered Java, we considered Silverlight, we considered JavaScript, and we considered Flash. At that point Flash was really on the ascendancy. Adobe was really pushing it. And we didn't yet know that it was going to be such a problem on iOS, and mobile devices, and so forth. So we went with Flash. And in retrospect it would've maybe been nicer if we'd gone with JavaScript because that's become the dominant language. But I don't think there's any way we could possibly have seen all the things that were going to change between then and now. And it takes three years or so to put together something like this. So you make your best guess and hope for the best. MITCHEL RESNICK: One new projects is called Scratch Junior, trying to have Scratch go down to even younger kids. It's being aimed at age five to seven year olds, like kindergarten to second grade. The first version of it will be on the iPad. And we plan to have it come out in the middle of 2014. So Scratch Junior will be a somewhat scaled down version. It will have somewhat fewer features, and also make things more developmentally appropriate for younger kids. JOHN MALONEY: I enjoy the fact that Scratch 2.0, especially, is sort of secretly higher performance than you might imagine. By default, when you're doing animations and so forth, you're limited to the update rate of the screen. And we designed it deliberately so that it only does a little bit per frame, so that if you say repeat 10, move 10, you actually see it move in ten little increments. However, there's a sort of hidden mode called turbo mode, which you can get by shift clicking on the green flag. And that basically lets it run kind of as fast as it can. So this is what lets you do things like the ray tracer, and you don't have to-- the original ray tracer, you had to wait like about half an hour to see the results, because it was kind of chugging through one frame at a time. But, with the shift click thing, you can get the results in something like twenty seconds. So all of a sudden you can just sort of high level things in Scratch, but it's a hidden feature. SPEAKER 1: Thank you so much to Mitchel and John for everything they've done for CS50. Thanks to Andrew, Al, and Shelley, who are behind the cameras this week. And thanks so much to all of the students, those of you out there who submitted content. And indeed, if you would like to contribute content for a future week, do reach out to us via Facebook, Reddit, Twitter, or any of the other course's means. That's it for CS50 Live. This was CS50. Damn it.