1 00:00:00,000 --> 00:00:00,080 2 00:00:00,080 --> 00:00:03,310 DAVID MALAN: --it on problem set zero, so we'll be back in five minutes. 3 00:00:03,310 --> 00:00:05,485 All right, so we are back and in our-- 4 00:00:05,485 --> 00:00:08,610 DOUG LLOYD: Prepare quickly now, we're nearing the end of the first lecture 5 00:00:08,610 --> 00:00:11,207 and we're going to start introducing programming, 6 00:00:11,207 --> 00:00:14,290 but we're not going to be doing it with a text based programming language, 7 00:00:14,290 --> 00:00:15,790 we're going to do it with Scratch. 8 00:00:15,790 --> 00:00:18,540 What's interesting about Scratch is that if you go to the website, 9 00:00:18,540 --> 00:00:21,750 it's sort of advertised as being for kids six and up, 10 00:00:21,750 --> 00:00:26,252 so it has this childish look to it maybe or a-- 11 00:00:26,252 --> 00:00:27,210 DAVID MALAN: Childlike. 12 00:00:27,210 --> 00:00:31,356 DOUG LLOYD: --childlike look to it, but it's actually quite a powerful language 13 00:00:31,356 --> 00:00:32,189 underneath the hood. 14 00:00:32,189 --> 00:00:35,430 DAVID MALAN: It is, it has a pretty high ceiling so to speak and wide walls, 15 00:00:35,430 --> 00:00:39,302 to borrow Professor Mitchel Resnick's terminology around the language. 16 00:00:39,302 --> 00:00:41,010 This is an environment that was initially 17 00:00:41,010 --> 00:00:43,920 targeted at students and after school programs, quite young ones, 18 00:00:43,920 --> 00:00:47,100 but we actually adopted it some years ago for higher education 19 00:00:47,100 --> 00:00:50,310 and for CS50 specifically so as to introduce some basic programming 20 00:00:50,310 --> 00:00:54,330 constructs like loops, and conditions, and functions more recently. 21 00:00:54,330 --> 00:00:56,274 We also look at threads and events, so it 22 00:00:56,274 --> 00:00:58,190 has this high ceiling in that you can actually 23 00:00:58,190 --> 00:01:00,606 cover some pretty sophisticated topics that would actually 24 00:01:00,606 --> 00:01:04,319 take weeks in a more traditional language like C or Java to get to, 25 00:01:04,319 --> 00:01:06,060 but it's all pretty-- 26 00:01:06,060 --> 00:01:09,630 I think within students grasp early on, because we give them examples 27 00:01:09,630 --> 00:01:12,120 by way of this portion of the lecture via which 28 00:01:12,120 --> 00:01:14,790 you can apply those constructs to very reasonable problems 29 00:01:14,790 --> 00:01:16,362 in a graphical environment no less. 30 00:01:16,362 --> 00:01:18,570 And my god, I mean look at the most canonical program 31 00:01:18,570 --> 00:01:20,850 you might write in C just to say, hello world, 32 00:01:20,850 --> 00:01:22,779 there's so much syntactic overhead 33 00:01:22,779 --> 00:01:25,320 DOUG LLOYD: Yeah, it's a little heavy the first time you see. 34 00:01:25,320 --> 00:01:27,840 DAVID MALAN: They include the ints, the parentheses, the semicolons. 35 00:01:27,840 --> 00:01:29,850 I mean, none of which are intellectually interesting. 36 00:01:29,850 --> 00:01:32,850 You really want to get to the heart of the program, which really is just 37 00:01:32,850 --> 00:01:34,860 printing a message like hello world. 38 00:01:34,860 --> 00:01:36,840 And we can do that with Scratch. 39 00:01:36,840 --> 00:01:39,210 DOUG LLOYD: Now we've been using Scratch since 2007, 40 00:01:39,210 --> 00:01:43,620 but since then there's been a number of other drag and drop programming 41 00:01:43,620 --> 00:01:45,510 languages like Snap or App Inventor. 42 00:01:45,510 --> 00:01:48,160 How come we haven't switched to using one of those 43 00:01:48,160 --> 00:01:50,970 or perhaps allowing for mobile development or something like? 44 00:01:50,970 --> 00:01:52,830 DAVID MALAN: So, it's definitely unfortunate 45 00:01:52,830 --> 00:01:54,660 that the current version of Scratch remains 46 00:01:54,660 --> 00:01:56,850 based in Flash, which limits the number of devices 47 00:01:56,850 --> 00:01:58,470 increasingly that it can be used on. 48 00:01:58,470 --> 00:02:00,120 DOUG LLOYD: Although that seems to be soon changing. 49 00:02:00,120 --> 00:02:01,286 DAVID MALAN: Indeed, indeed. 50 00:02:01,286 --> 00:02:05,850 They are making strides with Scratch 3.0 toward being HTML5 and JavaScript 51 00:02:05,850 --> 00:02:07,020 based, which will be great. 52 00:02:07,020 --> 00:02:09,060 Snap is already there, out of US Berkeley. 53 00:02:09,060 --> 00:02:14,270 This is a adaptation of Scratch that is implemented for web browsers in HTML5 54 00:02:14,270 --> 00:02:15,750 and JavaScript which works. 55 00:02:15,750 --> 00:02:19,110 I've just had certainly a personal preference for Scratch, 56 00:02:19,110 --> 00:02:22,397 I mean it's kind of part of our origin story over the past 10 years. 57 00:02:22,397 --> 00:02:24,480 So there's that sort of loyalty there, and we only 58 00:02:24,480 --> 00:02:26,721 spend just one problem set in one week on it, 59 00:02:26,721 --> 00:02:29,220 but it's definitely suboptimal now that some of our students 60 00:02:29,220 --> 00:02:33,240 who might want to use a tablet device or might otherwise not want 61 00:02:33,240 --> 00:02:35,430 to install Flash on their computer these days-- 62 00:02:35,430 --> 00:02:37,530 It's not great. 63 00:02:37,530 --> 00:02:39,780 But I think in terms of capabilities it's wonderful, 64 00:02:39,780 --> 00:02:43,050 and I think even more compelling is the galleries and the shareability online. 65 00:02:43,050 --> 00:02:47,400 What MIT really focused on in Mitchel's group focused on in their Lifelong 66 00:02:47,400 --> 00:02:50,370 Kindergarten group is on creating shareability and reusability, 67 00:02:50,370 --> 00:02:51,576 remixing so to speak. 68 00:02:51,576 --> 00:02:54,450 And the fact that our students by just logging into Scratch's website 69 00:02:54,450 --> 00:02:57,360 can share their works, not just with each other, but the whole world, 70 00:02:57,360 --> 00:03:01,325 add a nice, I think proud opportunity very early on in the class. 71 00:03:01,325 --> 00:03:04,200 DOUG LLOYD: No, it does, and I think that that focus on the community 72 00:03:04,200 --> 00:03:07,131 aspect, which ties in really nicely to CS50s own focus on community 73 00:03:07,131 --> 00:03:10,130 is a really nice touch, and it's a great way to start the term, I think. 74 00:03:10,130 --> 00:03:10,575 DAVID MALAN: I think so. 75 00:03:10,575 --> 00:03:13,180 It's a nice way of bookending it too, because we end of course with the CS50 76 00:03:13,180 --> 00:03:15,388 Fair where students are exhibiting all of these works 77 00:03:15,388 --> 00:03:17,880 that they created in other more modern languages, or more 78 00:03:17,880 --> 00:03:20,430 traditional languages, but right from the get go to can 79 00:03:20,430 --> 00:03:22,370 you experience a little taste of that. 80 00:03:22,370 --> 00:03:23,820 And I think that's compelling. 81 00:03:23,820 --> 00:03:27,195 And you can also learn so readily as a result from other student's programs 82 00:03:27,195 --> 00:03:28,320 that are already out there. 83 00:03:28,320 --> 00:03:31,740 You can delight in friends programs or kind of share them around. 84 00:03:31,740 --> 00:03:39,330 So as such, that feature alone is pretty compelling, so we've stuck with it. 85 00:03:39,330 --> 00:03:42,440 Notice the Easter egg, repeat 50 times.