1 00:00:00,000 --> 00:00:01,980 2 00:00:01,980 --> 00:00:02,970 DAVID MALAN: All right. 3 00:00:02,970 --> 00:00:04,890 Looks like we have just about everyone back. 4 00:00:04,890 --> 00:00:07,890 Well, if you just joined, welcome to the CS50 Educator Workshop. 5 00:00:07,890 --> 00:00:11,110 My name is David Malan, and I teach this course here at Harvard in Cambridge, 6 00:00:11,110 --> 00:00:13,140 Massachusetts called CS50. 7 00:00:13,140 --> 00:00:15,570 We started these workshops over five years ago 8 00:00:15,570 --> 00:00:18,990 now, toward an end of just making it easier for teachers like us, 9 00:00:18,990 --> 00:00:24,000 like you, to adopt or adapt introductory materials like CS50 Zone. 10 00:00:24,000 --> 00:00:26,573 The course has since evolved into multiple different flavors, 11 00:00:26,573 --> 00:00:27,240 as you may know. 12 00:00:27,240 --> 00:00:29,532 Not only the version that we offer here, traditionally, 13 00:00:29,532 --> 00:00:32,759 on campus, but also online through Harvard's Extension School for adults. 14 00:00:32,759 --> 00:00:36,930 And others as a massive open online course through edX, 15 00:00:36,930 --> 00:00:40,150 as well as now some Follow On and some precursor courses. 16 00:00:40,150 --> 00:00:42,900 Some of which you might be familiar with, like CS50's Introduction 17 00:00:42,900 --> 00:00:46,860 to Technology, Computer Science for Business Professionals; 18 00:00:46,860 --> 00:00:50,520 Follow On courses on game development, web development, 19 00:00:50,520 --> 00:00:52,200 artificial intelligence, and more. 20 00:00:52,200 --> 00:00:56,070 So indeed, particularly at the k-12 level, or maybe 7 to 12 level, 21 00:00:56,070 --> 00:00:58,440 have we really been focusing in recent years, 22 00:00:58,440 --> 00:01:01,440 on making sure teachers have more runway. 23 00:01:01,440 --> 00:01:04,800 So that they can actually put together using some of their own materials 24 00:01:04,800 --> 00:01:09,030 and perhaps some of ours, a full three or four year program. 25 00:01:09,030 --> 00:01:12,400 Particularly for younger students, and now older students as well. 26 00:01:12,400 --> 00:01:15,600 So this workshop, being online, just like last summer. 27 00:01:15,600 --> 00:01:19,440 We're taking for granted that folks are familiar with the course 28 00:01:19,440 --> 00:01:23,220 in various aspects per Carter's emails over the past couple of weeks. 29 00:01:23,220 --> 00:01:25,560 There were materials from last summer, that we again 30 00:01:25,560 --> 00:01:29,200 made available this summer, just to help on-board folks do some of the basics. 31 00:01:29,200 --> 00:01:31,770 So today and tomorrow, we'll generally assume 32 00:01:31,770 --> 00:01:35,580 that folks are already familiar with CS50 in all of its forms 33 00:01:35,580 --> 00:01:36,660 to some extent. 34 00:01:36,660 --> 00:01:40,260 And indeed, this weekend will be as hands on and as discussion oriented 35 00:01:40,260 --> 00:01:41,020 as we can make it. 36 00:01:41,020 --> 00:01:44,010 So that you feel like, Zoom wise, it's as high value 37 00:01:44,010 --> 00:01:47,010 as we can do things online these days. 38 00:01:47,010 --> 00:01:49,320 Before we dive into this morning's first session, 39 00:01:49,320 --> 00:01:50,970 wanted to make a few introductions. 40 00:01:50,970 --> 00:01:53,880 I'm joined here ultimately by CS50's own Brian 41 00:01:53,880 --> 00:01:57,750 Yu, who you might know from the web class, the AI class, and CS50 itself. 42 00:01:57,750 --> 00:02:01,540 But let me first introduce you to two of our newest team members, 43 00:02:01,540 --> 00:02:03,720 one of whom you've heard from email already. 44 00:02:03,720 --> 00:02:05,760 Carter Zenke and Bernie Longboy, who have 45 00:02:05,760 --> 00:02:07,830 joined us now on the team here in Cambridge 46 00:02:07,830 --> 00:02:10,199 to focus particularly on a lot of these outreach 47 00:02:10,199 --> 00:02:13,170 and AP high school and older efforts. 48 00:02:13,170 --> 00:02:14,900 Carter, over to you. 49 00:02:14,900 --> 00:02:16,150 CARTER ZENKE: Hello, everyone. 50 00:02:16,150 --> 00:02:19,050 It's so wonderful to see you all in one place. 51 00:02:19,050 --> 00:02:21,600 I'm really excited for this workshop we have together. 52 00:02:21,600 --> 00:02:24,788 As David has said, and I've been saying over our emails together, 53 00:02:24,788 --> 00:02:26,580 this is intended to be a celebration of all 54 00:02:26,580 --> 00:02:30,750 of our work as educators and as teachers involved with CS50. 55 00:02:30,750 --> 00:02:33,100 To that end, today we have several presentations 56 00:02:33,100 --> 00:02:35,100 from educators who have deeply thought about how 57 00:02:35,100 --> 00:02:37,800 to make their CS50 classrooms as engaging 58 00:02:37,800 --> 00:02:39,582 and transformative as possible. 59 00:02:39,582 --> 00:02:42,540 And we'll also have some dedicated sessions for you to meet each other, 60 00:02:42,540 --> 00:02:45,240 and talk about your own experiences teaching CS50, 61 00:02:45,240 --> 00:02:47,862 and how you can further improve your practice. 62 00:02:47,862 --> 00:02:50,820 I'm really excited to see what we'll all talk about during our workshop 63 00:02:50,820 --> 00:02:51,310 together. 64 00:02:51,310 --> 00:02:52,518 Thank you all for being here. 65 00:02:52,518 --> 00:02:53,575 Excited to do it. 66 00:02:53,575 --> 00:02:55,200 BERNIE LONGBOY: Good morning, everyone. 67 00:02:55,200 --> 00:02:57,270 I just want to welcome everyone as well. 68 00:02:57,270 --> 00:02:58,730 And look forward to this weekend. 69 00:02:58,730 --> 00:03:02,240 I'm very excited with you all to learn so much too. 70 00:03:02,240 --> 00:03:06,265 So have a great, great morning this morning. 71 00:03:06,265 --> 00:03:08,390 DAVID MALAN: And for those who might not know him-- 72 00:03:08,390 --> 00:03:10,915 Brian, do you want to say a formal hello as well? 73 00:03:10,915 --> 00:03:11,540 BRIAN YU: Sure. 74 00:03:11,540 --> 00:03:12,490 Hi, everyone. 75 00:03:12,490 --> 00:03:16,190 It's so good to be here at another CS50 Educator workshop. 76 00:03:16,190 --> 00:03:19,880 I first attended my first Educator workshop back in 2016. 77 00:03:19,880 --> 00:03:23,080 And every year I've been to one, it's been amazing to see the ideas 78 00:03:23,080 --> 00:03:24,830 that educators have been able to bring up, 79 00:03:24,830 --> 00:03:27,108 and thinking about how best to support students 80 00:03:27,108 --> 00:03:28,400 as they learn computer science. 81 00:03:28,400 --> 00:03:30,972 So, it's so good to see everyone here this weekend. 82 00:03:30,972 --> 00:03:32,180 DAVID MALAN: Indeed, welcome. 83 00:03:32,180 --> 00:03:34,520 So within the breakout groups and smaller sessions, 84 00:03:34,520 --> 00:03:36,728 you'll definitely have an opportunity to meet others. 85 00:03:36,728 --> 00:03:39,620 Feel free to use the chat window though throughout today and tomorrow 86 00:03:39,620 --> 00:03:40,430 to just say hello. 87 00:03:40,430 --> 00:03:42,722 In fact, if you'd like to say right now, as some of you 88 00:03:42,722 --> 00:03:45,160 already have, "Hello", from wherever in the world you are. 89 00:03:45,160 --> 00:03:50,390 It's always quite fun to see just what's breadth of teachers are able now, 90 00:03:50,390 --> 00:03:53,060 especially that things are online, to attend with us. 91 00:03:53,060 --> 00:03:55,760 For this first morning session here in Cambridge, 92 00:03:55,760 --> 00:03:58,700 we thought we would offer something called "CS50 Explained, 93 00:03:58,700 --> 00:04:00,320 Behind the Pedagogy". 94 00:04:00,320 --> 00:04:04,850 In part, the goal here is to answer in one fell swoop as many frequently asked 95 00:04:04,850 --> 00:04:06,020 questions as we can. 96 00:04:06,020 --> 00:04:09,560 Particularly some that we've seen in workshops past. 97 00:04:09,560 --> 00:04:13,520 And also to resurrect something, or evoke really, 98 00:04:13,520 --> 00:04:15,650 something that we started doing a few years ago. 99 00:04:15,650 --> 00:04:17,630 Where a colleague and I would actually rewatch 100 00:04:17,630 --> 00:04:20,700 CA50 Zone lectures, and talk about the "Why". 101 00:04:20,700 --> 00:04:24,590 Students typically are more interested, daresay, in the "What", 102 00:04:24,590 --> 00:04:27,738 and just making sure that they're comprehending what it is we or you 103 00:04:27,738 --> 00:04:29,280 might be presenting in the classroom. 104 00:04:29,280 --> 00:04:31,030 But for teachers sake, we thought we would 105 00:04:31,030 --> 00:04:32,600 try to peel back the curtain a bit. 106 00:04:32,600 --> 00:04:37,430 And give you a look at, or some justification for, "why" we in CS50 107 00:04:37,430 --> 00:04:39,615 do some of the things the way we do. 108 00:04:39,615 --> 00:04:41,990 We don't claim that these are necessarily the right ways, 109 00:04:41,990 --> 00:04:45,950 we can only argue that this is the reason we do things and why. 110 00:04:45,950 --> 00:04:48,950 But by all means, feel free to interject throughout this morning session 111 00:04:48,950 --> 00:04:53,090 with any questions in the chat, any virtual hands in Zoom, 112 00:04:53,090 --> 00:04:56,960 and certainly feel free to raise some of these same questions in later today's 113 00:04:56,960 --> 00:04:58,340 sessions as well. 114 00:04:58,340 --> 00:05:01,100 Brian, shall I turn the floor over to you? 115 00:05:01,100 --> 00:05:04,003 And Brian and I will have a conversation of sorts, 116 00:05:04,003 --> 00:05:06,420 even though both he and I rather know where this is going. 117 00:05:06,420 --> 00:05:09,030 But again, please do interject at any point. 118 00:05:09,030 --> 00:05:10,610 Brian? 119 00:05:10,610 --> 00:05:13,730 BRIAN YU: So I thought we would start with one of the topics 120 00:05:13,730 --> 00:05:16,820 that I think a lot of people ask about when they first hear about CS50 121 00:05:16,820 --> 00:05:18,230 and CS50's curriculum. 122 00:05:18,230 --> 00:05:22,340 And that is the programming languages that CS50 ends up using. 123 00:05:22,340 --> 00:05:25,940 So I see on your slide that CS50 covers a lot of different languages-- 124 00:05:25,940 --> 00:05:30,315 Scratch, and C, and Python; SQL, HTML, CSS, and JavaScript. 125 00:05:30,315 --> 00:05:31,940 So that's a lot of different languages. 126 00:05:31,940 --> 00:05:34,460 Well, another reasonable approach might be 127 00:05:34,460 --> 00:05:37,400 for spending an entire course diving deeply 128 00:05:37,400 --> 00:05:40,483 into one language like just C or just Python. 129 00:05:40,483 --> 00:05:42,650 So I was hoping you could maybe tell us a little bit 130 00:05:42,650 --> 00:05:46,070 about your thinking behind choosing these languages, 131 00:05:46,070 --> 00:05:49,703 and multiple different languages for the class. 132 00:05:49,703 --> 00:05:51,870 DAVID MALAN: So, it's a really good question, Brian. 133 00:05:51,870 --> 00:05:53,790 I'm glad you brought this on up. 134 00:05:53,790 --> 00:05:57,770 So, I think CS50 here at Harvard has been around for some 30 years. 135 00:05:57,770 --> 00:06:01,160 And back when I took it myself, some 20+ years ago, 136 00:06:01,160 --> 00:06:04,820 I feel like I and a lot of students emerged from the class in an earlier 137 00:06:04,820 --> 00:06:08,510 form of it, thinking of the class as a course in C. 138 00:06:08,510 --> 00:06:11,840 And indeed, at the time, it pretty much only focused on C 139 00:06:11,840 --> 00:06:13,350 throughout the entire semester. 140 00:06:13,350 --> 00:06:15,890 And so, as a result, I and I think some of my classmates 141 00:06:15,890 --> 00:06:19,970 emerged, ultimately, with a mental model of "I know how to program in C" 142 00:06:19,970 --> 00:06:21,860 or "I took a C class". 143 00:06:21,860 --> 00:06:24,740 And the downside of this is, that certainly with a language like C, 144 00:06:24,740 --> 00:06:27,282 it's not one that you would typically reach for off-the-shelf 145 00:06:27,282 --> 00:06:28,280 to solve problems. 146 00:06:28,280 --> 00:06:31,700 Generally, after taking a course in it, unless you're a lower level systems 147 00:06:31,700 --> 00:06:36,260 type programmer-- and we, in retrospect, I wish I had been, 148 00:06:36,260 --> 00:06:39,620 I had appreciated as a student that what I really did learn 149 00:06:39,620 --> 00:06:42,962 was not just how to program in C, but to how to program more generally. 150 00:06:42,962 --> 00:06:45,170 But what I didn't have at the time was an opportunity 151 00:06:45,170 --> 00:06:48,500 to try to apply some of the lessons in that original course 152 00:06:48,500 --> 00:06:49,880 to just other domains. 153 00:06:49,880 --> 00:06:52,640 And pick up languages with the support structure of a professor 154 00:06:52,640 --> 00:06:54,800 and a whole teaching staff, teaching assistants, 155 00:06:54,800 --> 00:06:56,700 some of my undergraduate classmates. 156 00:06:56,700 --> 00:06:59,000 And so, when I took over the course some years later, 157 00:06:59,000 --> 00:07:02,810 and this is now 16 years ago, I had just exited graduate school. 158 00:07:02,810 --> 00:07:05,090 Where I had the opportunity to take a class at MIT's 159 00:07:05,090 --> 00:07:07,760 Media Lab, where they had literally just been 160 00:07:07,760 --> 00:07:11,540 beta testing Scratch, this graphical language, for the very first time. 161 00:07:11,540 --> 00:07:14,010 And we were using it in the graduate course I was taking. 162 00:07:14,010 --> 00:07:17,660 And so, when I finished grad school and then started teaching CS50 a year 163 00:07:17,660 --> 00:07:21,020 or two later, we added Scratch to the very beginning of the course. 164 00:07:21,020 --> 00:07:25,550 And the goal was, to send a message very early on that, one, programming 165 00:07:25,550 --> 00:07:27,810 doesn't need to seem or be daunting. 166 00:07:27,810 --> 00:07:32,840 It doesn't need to look scary textually with parentheses, and semicolons, 167 00:07:32,840 --> 00:07:33,410 and the like. 168 00:07:33,410 --> 00:07:35,780 Scratch, from day one, allowed us to start 169 00:07:35,780 --> 00:07:39,650 focusing on concepts-- on functions, variables, conditions, loops 170 00:07:39,650 --> 00:07:43,220 and the like without the distraction of any more 171 00:07:43,220 --> 00:07:45,380 textual based languages distractions. 172 00:07:45,380 --> 00:07:49,850 Thereafter, I have always felt that C provides a very solid foundation 173 00:07:49,850 --> 00:07:50,700 from the ground up. 174 00:07:50,700 --> 00:07:52,450 It's not without its downsides, of course, 175 00:07:52,450 --> 00:07:54,560 in that memory management pointers and the like 176 00:07:54,560 --> 00:07:56,300 tend to get very sophisticated. 177 00:07:56,300 --> 00:07:59,420 But insofar as CS50, both for us here on campus 178 00:07:59,420 --> 00:08:02,670 and for a lot of people online who've been taking it for some years, 179 00:08:02,670 --> 00:08:03,830 is a terminal class. 180 00:08:03,830 --> 00:08:06,975 It's the one class that they take, from which 181 00:08:06,975 --> 00:08:08,600 they want to get some practical skills. 182 00:08:08,600 --> 00:08:10,580 They want to have an ability to program, but they 183 00:08:10,580 --> 00:08:12,747 don't want to become computer scientists themselves. 184 00:08:12,747 --> 00:08:16,130 So they might not necessarily go down the rabbit hole of other courses. 185 00:08:16,130 --> 00:08:19,550 We wanted to introduce students to another procedural language 186 00:08:19,550 --> 00:08:22,940 or language that has procedural aspects, namely Python. 187 00:08:22,940 --> 00:08:24,110 Years ago, it was PHP. 188 00:08:24,110 --> 00:08:24,920 Now, it's Python. 189 00:08:24,920 --> 00:08:27,350 And Python is just wonderfully multipurpose. 190 00:08:27,350 --> 00:08:30,480 You can use it for command line applications, web applications, data 191 00:08:30,480 --> 00:08:32,429 science applications nowadays. 192 00:08:32,429 --> 00:08:36,250 And so it's just a nice fit for the message that we want to send. 193 00:08:36,250 --> 00:08:38,190 And then at the tail end of the class, we also 194 00:08:38,190 --> 00:08:41,700 want students to understand the applicability of computer science. 195 00:08:41,700 --> 00:08:44,370 And to programming, to just something they see and use every day 196 00:08:44,370 --> 00:08:45,330 in web programming. 197 00:08:45,330 --> 00:08:48,150 Just really does resonate, certainly with our population here, 198 00:08:48,150 --> 00:08:49,530 and it seems, at large. 199 00:08:49,530 --> 00:08:51,690 Unfortunately, to introduce web programming, 200 00:08:51,690 --> 00:08:54,450 you need this additional fire hose of content. 201 00:08:54,450 --> 00:08:57,030 Not just HTML and CSS to do static stuff, 202 00:08:57,030 --> 00:08:59,490 but you ideally want to add in a little JavaScript 203 00:08:59,490 --> 00:09:02,880 these days, so that you can do some things interactively in the GUI. 204 00:09:02,880 --> 00:09:06,180 And honestly, you ideally want some place to put data, 205 00:09:06,180 --> 00:09:09,120 so that you can actually build proper applications 206 00:09:09,120 --> 00:09:12,060 that live on beyond the course, and for that we need SQL. 207 00:09:12,060 --> 00:09:13,920 So we can see, it is a lot. 208 00:09:13,920 --> 00:09:16,540 And students don't become an expert in any one of these. 209 00:09:16,540 --> 00:09:18,510 But nowadays, I do dare say that students 210 00:09:18,510 --> 00:09:22,680 exit the class with a mental model of having learned how to program. 211 00:09:22,680 --> 00:09:24,720 Not program in all paradigms, we don't really 212 00:09:24,720 --> 00:09:28,170 touch much OO or functional programming, if you're familiar with those. 213 00:09:28,170 --> 00:09:30,870 But they absolutely learn, pretty rigorously, 214 00:09:30,870 --> 00:09:34,500 how to program procedurally, so to speak. 215 00:09:34,500 --> 00:09:36,330 Brian? 216 00:09:36,330 --> 00:09:39,360 BRIAN YU: And looking at that list, it seems like the-- 217 00:09:39,360 --> 00:09:43,920 maybe one that you might least expect to see on a typical introductory course 218 00:09:43,920 --> 00:09:47,925 is the one on C. Like you mentioned, that C's been around in CS50 219 00:09:47,925 --> 00:09:50,350 since CS50 was first introduced at Harvard. 220 00:09:50,350 --> 00:09:53,640 And I was wondering if you could talk about why it stayed there. 221 00:09:53,640 --> 00:09:58,170 C is definitely, maybe, less popular now than it was before. 222 00:09:58,170 --> 00:10:01,650 And can you talk a little bit about the rationale 223 00:10:01,650 --> 00:10:07,200 behind what role C serves inside of this computer science curriculum? 224 00:10:07,200 --> 00:10:10,320 DAVID MALAN: So I do think that C is about as close to the hardware, 225 00:10:10,320 --> 00:10:13,050 so to speak, as you can get before things really 226 00:10:13,050 --> 00:10:16,380 get scary with something called Assembly language and the lower level machine 227 00:10:16,380 --> 00:10:20,040 instructions that are ultimately getting executed by the computer's CPU. 228 00:10:20,040 --> 00:10:24,870 C doesn't really have much in the way of libraries right out of the box, 229 00:10:24,870 --> 00:10:27,840 like a Python, like Java, even like C+ has. 230 00:10:27,840 --> 00:10:30,630 And so, if you want something to exist in C, 231 00:10:30,630 --> 00:10:33,133 you pretty much need to implement it yourself. 232 00:10:33,133 --> 00:10:35,550 Or at least there isn't a standard library in the same way 233 00:10:35,550 --> 00:10:36,750 as there is with other languages. 234 00:10:36,750 --> 00:10:39,480 That if you want a linked list, you grab it over here, if you want a hash table, 235 00:10:39,480 --> 00:10:40,630 you grab it over here. 236 00:10:40,630 --> 00:10:43,710 And so, it's a nice language in that syntactically or grammatically, 237 00:10:43,710 --> 00:10:45,450 it's relatively small. 238 00:10:45,450 --> 00:10:48,640 And with the couple of exceptions, students pretty much in CS50 239 00:10:48,640 --> 00:10:52,350 see all syntactic features of the language, 240 00:10:52,350 --> 00:10:55,290 minus things like unions and function pointers. 241 00:10:55,290 --> 00:10:58,892 But for the most part, students then use this language, 242 00:10:58,892 --> 00:11:01,350 and ultimately have an understanding of what's really going 243 00:11:01,350 --> 00:11:03,270 on underneath the hood of the computer. 244 00:11:03,270 --> 00:11:06,335 The memory management stuff can get into the weeds for many students, 245 00:11:06,335 --> 00:11:08,460 but at the end of the day, you realize that all you 246 00:11:08,460 --> 00:11:10,560 have is this canvas of bytes. 247 00:11:10,560 --> 00:11:13,650 Zeros and ones, or decimal digits, however you want to think about it. 248 00:11:13,650 --> 00:11:15,760 And you can use those however you see fit. 249 00:11:15,760 --> 00:11:19,050 So as complicated as all of today's software is that we write 250 00:11:19,050 --> 00:11:21,330 or that we might use on our computers, it all 251 00:11:21,330 --> 00:11:23,280 reduces to that very simple canvas. 252 00:11:23,280 --> 00:11:27,090 And I think as a result, students exit CS50 not just thinking, hopefully, 253 00:11:27,090 --> 00:11:30,210 that they are budding software developers. 254 00:11:30,210 --> 00:11:34,440 But that they're budding engineers, and they're budding computer scientists, 255 00:11:34,440 --> 00:11:36,750 because they really have this bottom up understanding. 256 00:11:36,750 --> 00:11:40,320 And my favorite moment still, both in PHP and now Python, 257 00:11:40,320 --> 00:11:43,650 is when we go in one week having students implement with the Speller 258 00:11:43,650 --> 00:11:48,720 problem set, if you're familiar, their very own hash table storing words 259 00:11:48,720 --> 00:11:50,070 from a big dictionary. 260 00:11:50,070 --> 00:11:53,460 And then the next week, do we distill that same program 261 00:11:53,460 --> 00:11:56,070 into eight lines of Python code. 262 00:11:56,070 --> 00:11:59,820 One line is what gives us the hash table or the dictionary. 263 00:11:59,820 --> 00:12:04,110 And I think, what an amazing way to emphasize the notion of abstraction 264 00:12:04,110 --> 00:12:07,020 than to show students that we can take those previous several weeks 265 00:12:07,020 --> 00:12:09,360 and now condense them into a language feature. 266 00:12:09,360 --> 00:12:13,045 267 00:12:13,045 --> 00:12:15,670 BRIAN YU: A few people in chat are mentioning that figuring out 268 00:12:15,670 --> 00:12:17,227 hash tables was really confusing. 269 00:12:17,227 --> 00:12:19,060 Yeah, I remember struggling a lot when I was 270 00:12:19,060 --> 00:12:22,330 first trying to implement my own hash table from scratch, 271 00:12:22,330 --> 00:12:24,470 working on this very assignment. 272 00:12:24,470 --> 00:12:26,380 But then, I also remember seeing in Python 273 00:12:26,380 --> 00:12:29,740 the first time, how you can do all of that in just a couple of lines of code. 274 00:12:29,740 --> 00:12:34,750 And really appreciating what it is that these higher level languages are also 275 00:12:34,750 --> 00:12:36,550 able to offer. 276 00:12:36,550 --> 00:12:38,920 And definitely at any point, I'm asking David questions. 277 00:12:38,920 --> 00:12:41,560 But if you have questions for me or David as well, definitely 278 00:12:41,560 --> 00:12:45,130 feel free to raise your virtual hand in Zoom, or type the question in the chat 279 00:12:45,130 --> 00:12:47,810 that I can relay to David as well. 280 00:12:47,810 --> 00:12:51,760 So if you have questions about CS50 and why the course does things the way 281 00:12:51,760 --> 00:12:55,518 that the course does things, happy to talk about those too. 282 00:12:55,518 --> 00:12:56,560 AHMAD ESSAYED: Hi, David. 283 00:12:56,560 --> 00:12:57,060 Hi, Brian. 284 00:12:57,060 --> 00:12:58,760 Hi, everyone. 285 00:12:58,760 --> 00:13:02,770 My question is about the shorts. 286 00:13:02,770 --> 00:13:08,830 Sometimes the shorts, I feel they-- 287 00:13:08,830 --> 00:13:13,670 sometimes they're helpful, but sometimes they are adding more confusion. 288 00:13:13,670 --> 00:13:18,040 So, sometimes David is covering one topic, 289 00:13:18,040 --> 00:13:20,950 but this topic needs more information. 290 00:13:20,950 --> 00:13:25,120 And David is leaving that to the shorts to cover. 291 00:13:25,120 --> 00:13:28,600 But I have the feeling that students sometimes 292 00:13:28,600 --> 00:13:32,080 need this to be covered in the lecture itself by David. 293 00:13:32,080 --> 00:13:39,850 So what's the rationale behind shorts, why not do it all in the lecture? 294 00:13:39,850 --> 00:13:43,270 And some of the shorts, they actually need 295 00:13:43,270 --> 00:13:46,348 to be discussed before the lectures. 296 00:13:46,348 --> 00:13:47,140 Before the lecture. 297 00:13:47,140 --> 00:13:49,557 Some of them, they need to be discussed after the lecture. 298 00:13:49,557 --> 00:13:53,890 And there is no roadmap for students. 299 00:13:53,890 --> 00:13:57,110 So they assume that they watch the lecture, then the shorts. 300 00:13:57,110 --> 00:14:00,410 But some of the topics in the shorts-- 301 00:14:00,410 --> 00:14:03,420 I feel that they should have been covered before the lecture itself. 302 00:14:03,420 --> 00:14:04,078 So-- 303 00:14:04,078 --> 00:14:05,120 DAVID MALAN: Interesting. 304 00:14:05,120 --> 00:14:07,650 In the chat, Ahmad, do you mind proposing a few examples? 305 00:14:07,650 --> 00:14:10,010 But in the meantime, I can respond in general. 306 00:14:10,010 --> 00:14:13,850 So, at least the way the traditional class here is structured on campus, 307 00:14:13,850 --> 00:14:16,010 we have certain constraints like time. 308 00:14:16,010 --> 00:14:18,290 Like the duration that a lecture can be. 309 00:14:18,290 --> 00:14:21,350 And the function of lectures, generally in our view, 310 00:14:21,350 --> 00:14:23,660 is to create this narrative for the week. 311 00:14:23,660 --> 00:14:26,990 To introduce students to a range of concepts that will then be explored 312 00:14:26,990 --> 00:14:28,730 in some form on the problem set. 313 00:14:28,730 --> 00:14:31,040 But we don't have the luxury, just practically 314 00:14:31,040 --> 00:14:32,900 speaking, to go down every rabbit hole. 315 00:14:32,900 --> 00:14:36,530 Or to focus as much as we might like in an ideal world on each 316 00:14:36,530 --> 00:14:39,140 of those topics in depth during that one seeding. 317 00:14:39,140 --> 00:14:42,410 So the approach we've taken over time, is to then define these shorts. 318 00:14:42,410 --> 00:14:44,660 Which, if unfamiliar, are indeed these shorter videos 319 00:14:44,660 --> 00:14:46,827 generally taught by a colleague of ours, Doug Lloyd, 320 00:14:46,827 --> 00:14:48,290 against a nice white backdrop. 321 00:14:48,290 --> 00:14:51,140 Wherein he focuses entirely on one topic-- 322 00:14:51,140 --> 00:14:54,980 so this is a topic on linked list, this is a short on arrays, 323 00:14:54,980 --> 00:14:56,990 this is a short on some other topic. 324 00:14:56,990 --> 00:15:00,860 And the goal there is to, one, indeed go down the rabbit hole 325 00:15:00,860 --> 00:15:02,390 of those individual topics. 326 00:15:02,390 --> 00:15:05,630 And also, frankly, pedagogically, to give students another person's 327 00:15:05,630 --> 00:15:07,710 perspective on the same topic. 328 00:15:07,710 --> 00:15:11,270 It's not just a rehash of the exact same examples, the exact same style. 329 00:15:11,270 --> 00:15:13,910 It's Doug's own take on that same material. 330 00:15:13,910 --> 00:15:17,270 Much like a student in our on-campus sections, or recitations, 331 00:15:17,270 --> 00:15:18,770 would see different exposure. 332 00:15:18,770 --> 00:15:20,870 I think, pragmatically speaking, if you're 333 00:15:20,870 --> 00:15:24,410 finding that certain shorts should come before a lecture, 334 00:15:24,410 --> 00:15:27,410 please do mention as much in the chat, or email me and Brian afterward. 335 00:15:27,410 --> 00:15:28,770 Because that's an easy fix. 336 00:15:28,770 --> 00:15:31,817 We can certainly guide students toward that more correctly. 337 00:15:31,817 --> 00:15:32,900 But that's not the intent. 338 00:15:32,900 --> 00:15:35,870 Generally, they're meant to be supplementary, optional resources 339 00:15:35,870 --> 00:15:38,120 for students if they want to dive in deeper 340 00:15:38,120 --> 00:15:42,120 to topics we looked at that week. 341 00:15:42,120 --> 00:15:44,310 Brian, if you don't mind my turning the tables here, 342 00:15:44,310 --> 00:15:47,417 because you've given quite a bit of thought to how we grade in CS50. 343 00:15:47,417 --> 00:15:50,250 And we grade in different ways based on the demographic of students, 344 00:15:50,250 --> 00:15:51,810 whether they're the traditional on-campus 345 00:15:51,810 --> 00:15:53,727 students, or the online students, or certainly 346 00:15:53,727 --> 00:15:55,820 via the massive open online course. 347 00:15:55,820 --> 00:15:58,320 It's a different experience to some extent for the students, 348 00:15:58,320 --> 00:16:02,190 as to just how much feedback we can viably provide tens of thousands 349 00:16:02,190 --> 00:16:03,330 of students online. 350 00:16:03,330 --> 00:16:06,750 So, Brian, we've generally presented to teachers in the past, 351 00:16:06,750 --> 00:16:08,490 that we take this three pronged approach. 352 00:16:08,490 --> 00:16:11,400 Three axis of correctness, design, and style. 353 00:16:11,400 --> 00:16:14,130 Do you want to speak to exactly what we mean by those three, 354 00:16:14,130 --> 00:16:17,065 and why we use those three? 355 00:16:17,065 --> 00:16:19,440 BRIAN YU: So these are the three things that we generally 356 00:16:19,440 --> 00:16:22,357 ask students to think about when they're working on their assignments. 357 00:16:22,357 --> 00:16:26,340 And the first one, and arguably the most important one, is just correctness. 358 00:16:26,340 --> 00:16:28,440 Which in our mind of answering the question-- 359 00:16:28,440 --> 00:16:32,400 does the student's code do, what our problem specification 360 00:16:32,400 --> 00:16:34,170 asked for the student's program to do? 361 00:16:34,170 --> 00:16:38,670 If we're asking them to build a pyramid made out of hash marks and spaces, 362 00:16:38,670 --> 00:16:41,280 are they using the right arrangement of hash marks and spaces? 363 00:16:41,280 --> 00:16:43,740 If they're building a spell checker, does it correctly 364 00:16:43,740 --> 00:16:45,720 identify the words that are misspelled? 365 00:16:45,720 --> 00:16:50,190 And it used to be the case that for correctness, I would manually 366 00:16:50,190 --> 00:16:52,320 test and run each of my students' programs, 367 00:16:52,320 --> 00:16:54,850 and test it on various different inputs. 368 00:16:54,850 --> 00:16:57,930 But now, we've built this tool called check50, 369 00:16:57,930 --> 00:16:59,940 which can be used by students and educators 370 00:16:59,940 --> 00:17:02,610 alike to do some automated assessment of correctness. 371 00:17:02,610 --> 00:17:05,579 And that's really helped to improve the speed at which we 372 00:17:05,579 --> 00:17:07,480 can get some feedback back to students. 373 00:17:07,480 --> 00:17:10,740 So students can be working on their own time, working on a problem, 374 00:17:10,740 --> 00:17:13,200 and run this tool, check50, to see-- 375 00:17:13,200 --> 00:17:15,359 have I really managed to solve this problem? 376 00:17:15,359 --> 00:17:18,630 Or are there maybe some edge cases that I haven't considered, 377 00:17:18,630 --> 00:17:21,480 or some bug in the program that I haven't quite noticed. 378 00:17:21,480 --> 00:17:25,050 And check50 can help students to think about the correctness of their program 379 00:17:25,050 --> 00:17:26,770 there as well. 380 00:17:26,770 --> 00:17:29,790 But we don't really want students to just stop there. 381 00:17:29,790 --> 00:17:33,180 That there are many ways to write a correct program that 382 00:17:33,180 --> 00:17:34,720 solves the problem. 383 00:17:34,720 --> 00:17:37,080 But some ways are going to be better than other ways. 384 00:17:37,080 --> 00:17:40,950 Better in terms of the efficiency and how long the program takes to run. 385 00:17:40,950 --> 00:17:44,310 Better in terms of the overall organization of the code 386 00:17:44,310 --> 00:17:48,510 and whether it's logical and makes sense, and other considerations 387 00:17:48,510 --> 00:17:52,170 that we generally categorize under the second heading of design. 388 00:17:52,170 --> 00:17:56,340 And design, then, is all about how well written is the code. 389 00:17:56,340 --> 00:17:59,260 Even if regardless of whether it's correct or not. 390 00:17:59,260 --> 00:18:03,240 Are they making good use of programming constructs like loops and conditions 391 00:18:03,240 --> 00:18:04,950 where it's appropriate to do so. 392 00:18:04,950 --> 00:18:07,380 Are they repeating themselves a lot when it 393 00:18:07,380 --> 00:18:09,300 might be better to create a different function 394 00:18:09,300 --> 00:18:11,217 to do some of that same behavior. 395 00:18:11,217 --> 00:18:13,050 And so, here is where really the opportunity 396 00:18:13,050 --> 00:18:15,180 is to teach good design practices. 397 00:18:15,180 --> 00:18:18,580 Teaching not only how to write code, but how to write code well. 398 00:18:18,580 --> 00:18:22,410 And then the final consideration that we look at when grading is style. 399 00:18:22,410 --> 00:18:25,140 And style is less about the efficiency of the code, 400 00:18:25,140 --> 00:18:27,120 and is more just about how the code looks. 401 00:18:27,120 --> 00:18:31,710 Because, especially if students are aspiring to become software engineers 402 00:18:31,710 --> 00:18:34,170 or working in computer science in the future-- 403 00:18:34,170 --> 00:18:37,920 writing code that is readable by other people, whether it's by coworkers, 404 00:18:37,920 --> 00:18:41,550 or other people on the internet, or even you as the educator, 405 00:18:41,550 --> 00:18:42,720 that's really important too. 406 00:18:42,720 --> 00:18:45,137 So that it's clear what you mean when you're writing code. 407 00:18:45,137 --> 00:18:47,190 That it's easy to follow and easy to read. 408 00:18:47,190 --> 00:18:51,800 And we want to encourage those best style practices too. 409 00:18:51,800 --> 00:18:53,050 DAVID MALAN: Thank you, Brian. 410 00:18:53,050 --> 00:18:55,092 There was a question in the chat about a project, 411 00:18:55,092 --> 00:18:57,550 but would be best to email that to someone, something 412 00:18:57,550 --> 00:18:59,740 like certificates@cs50.harvard.edu. 413 00:18:59,740 --> 00:19:02,290 We can paste that email into the chat. 414 00:19:02,290 --> 00:19:05,200 Well, transitioning perhaps to-- no, actually, one 415 00:19:05,200 --> 00:19:07,230 note on grading philosophy if I may. 416 00:19:07,230 --> 00:19:10,090 So here on campus, where we have the luxury of having 417 00:19:10,090 --> 00:19:13,570 a reasonably manageable ratio between teachers and students by nature 418 00:19:13,570 --> 00:19:16,660 of it being a traditional course offering, here in a college environment 419 00:19:16,660 --> 00:19:18,220 where we have a number of TAs. 420 00:19:18,220 --> 00:19:21,310 And so, we're able to provide feedback along each of these axis. 421 00:19:21,310 --> 00:19:25,210 Generally speaking our online students, whether taking CS50 AP through edX, 422 00:19:25,210 --> 00:19:28,120 or CS50x, or any of the courses, do indeed as Brian notes, 423 00:19:28,120 --> 00:19:32,710 rely on the automated correctness tool, namely check50 in our case, 424 00:19:32,710 --> 00:19:34,120 to focus on correctness. 425 00:19:34,120 --> 00:19:37,000 Style too, to some extent, we rely on style50-- 426 00:19:37,000 --> 00:19:40,600 a linter tool that provides, indeed, this sort of quantitative feedback 427 00:19:40,600 --> 00:19:41,740 as best it can. 428 00:19:41,740 --> 00:19:48,885 Design though, is really the most labor intensive axis along 429 00:19:48,885 --> 00:19:50,260 which to evaluate students' work. 430 00:19:50,260 --> 00:19:52,150 And certainly teachers in high school, if I think back 431 00:19:52,150 --> 00:19:53,620 when I had some 100 students. 432 00:19:53,620 --> 00:19:55,870 And I was getting homework per week, and that was just 433 00:19:55,870 --> 00:19:57,730 in math not even in computer science. 434 00:19:57,730 --> 00:20:02,020 Is it pretty daunting to even imagine going through and qualitatively 435 00:20:02,020 --> 00:20:03,412 providing feedback as well? 436 00:20:03,412 --> 00:20:06,370 So these are among the knobs that we generally find that teachers turn. 437 00:20:06,370 --> 00:20:09,970 Focusing, for instance, generally on only one, maybe two, of these axis, 438 00:20:09,970 --> 00:20:11,620 but not necessarily all three. 439 00:20:11,620 --> 00:20:14,980 Fortunately, with the trends being what they are in artificial intelligence 440 00:20:14,980 --> 00:20:17,620 and machine learning, we're hopeful that even design 441 00:20:17,620 --> 00:20:21,400 will be able to be automated to some extent by computers before long. 442 00:20:21,400 --> 00:20:25,120 But at least within our ecosystem, we're not quite there yet. 443 00:20:25,120 --> 00:20:27,850 But thought we would now pivot to what we've described, 444 00:20:27,850 --> 00:20:31,090 and what most anyone would describe, as memorable moments, hopefully. 445 00:20:31,090 --> 00:20:34,540 Particularly among students, seeing what they see-- on our case on camera, 446 00:20:34,540 --> 00:20:36,910 but what you probably do most any day in the classroom, 447 00:20:36,910 --> 00:20:39,230 any time you try to bring some topic to life. 448 00:20:39,230 --> 00:20:41,920 And we thought we would give just a few examples of some 449 00:20:41,920 --> 00:20:47,500 of the visuals, some of the theatrics that we try to integrate into CS50 450 00:20:47,500 --> 00:20:48,730 here itself. 451 00:20:48,730 --> 00:20:53,620 And, by way of a few photos, might you recognize this? 452 00:20:53,620 --> 00:20:56,240 These are getting harder and harder to find, honestly. 453 00:20:56,240 --> 00:20:59,470 But if you ever want to do a demonstration of binary search, 454 00:20:59,470 --> 00:21:03,880 or divide and conquer more generally, or really problem solving most generally-- 455 00:21:03,880 --> 00:21:06,970 I definitely recommend keeping an eye out for these in the mail room 456 00:21:06,970 --> 00:21:10,090 or on someone's shelf who clearly doesn't need that phone book anymore. 457 00:21:10,090 --> 00:21:13,630 And to use this, as perhaps one of the earliest visuals 458 00:21:13,630 --> 00:21:14,710 to present to students. 459 00:21:14,710 --> 00:21:19,570 And nowadays, I think it's probably important to link this physical device 460 00:21:19,570 --> 00:21:22,870 to the Virtual Contacts app in everyone's Android device 461 00:21:22,870 --> 00:21:23,860 or iPhone device. 462 00:21:23,860 --> 00:21:25,430 But it really is the same problem. 463 00:21:25,430 --> 00:21:27,790 So even though this is the old school incarnation of it, 464 00:21:27,790 --> 00:21:30,730 this ripping of the phone book at the beginning of CS50, 465 00:21:30,730 --> 00:21:33,490 which probably is not something students often see, 466 00:21:33,490 --> 00:21:36,970 is one of the memorable moments that we try to create. 467 00:21:36,970 --> 00:21:41,170 So that even as we get into the weeds of these fairly arcane topics, very 468 00:21:41,170 --> 00:21:45,010 unfamiliar topics for many students, they can latch onto, "OK, 469 00:21:45,010 --> 00:21:46,000 binary search. 470 00:21:46,000 --> 00:21:47,200 Oh, phone book." 471 00:21:47,200 --> 00:21:50,740 And they at least have those visuals that can help remind them of the topic. 472 00:21:50,740 --> 00:21:54,040 And at least help them find that same material in their mind's 473 00:21:54,040 --> 00:21:56,890 eye or, say, on the course's website. 474 00:21:56,890 --> 00:22:00,455 Brian, this next one here is representative 475 00:22:00,455 --> 00:22:02,080 of a general problem solving technique. 476 00:22:02,080 --> 00:22:06,460 Do you want to speak to why we put this black box on the stage? 477 00:22:06,460 --> 00:22:10,420 BRIAN YU: So we use the black box to introduce a topic in computer science 478 00:22:10,420 --> 00:22:12,610 that's commonly known as abstraction. 479 00:22:12,610 --> 00:22:16,130 And having worked with CS50 students year after year, 480 00:22:16,130 --> 00:22:19,720 this is one of the trickiest topics for students to really understand at first. 481 00:22:19,720 --> 00:22:22,060 What does abstraction mean? 482 00:22:22,060 --> 00:22:24,038 And one of the ways that we try to frame it, 483 00:22:24,038 --> 00:22:26,830 and there are lots of different ways of trying to frame abstraction 484 00:22:26,830 --> 00:22:30,460 and what it's all about, is in recognizing 485 00:22:30,460 --> 00:22:34,750 that dealing with all of the details of every part of a computer program 486 00:22:34,750 --> 00:22:39,050 might get extremely complex and difficult to reason about. 487 00:22:39,050 --> 00:22:41,980 But if you can start to think about things as more of a black box, 488 00:22:41,980 --> 00:22:44,710 you provide input into some part of the program, 489 00:22:44,710 --> 00:22:47,050 and that black box might produce some output. 490 00:22:47,050 --> 00:22:50,630 Then thinking about those components of the program, 491 00:22:50,630 --> 00:22:54,310 even if you don't understand everything going on inside of that black box, 492 00:22:54,310 --> 00:22:57,280 can help you to build bigger pieces together and construct 493 00:22:57,280 --> 00:22:59,170 more interesting programs. 494 00:22:59,170 --> 00:23:02,320 And that's a tricky concept to understand and code at first. 495 00:23:02,320 --> 00:23:05,530 And we hope that the black box visual is a bit of a metaphor 496 00:23:05,530 --> 00:23:08,388 that students can use for thinking about that type of thing too. 497 00:23:08,388 --> 00:23:11,430 DAVID MALAN: Brian, let me pluck off a couple of questions from the chat. 498 00:23:11,430 --> 00:23:15,560 Can CS50x students have access to sections as recorded in video? 499 00:23:15,560 --> 00:23:17,580 So this is actually one of the reasons too, 500 00:23:17,580 --> 00:23:19,950 why we provide the shorts, as well as most recently, 501 00:23:19,950 --> 00:23:23,490 the videos within the labs that were introduced this past year. 502 00:23:23,490 --> 00:23:26,940 Because those sections are generally more discussion oriented, and not high 503 00:23:26,940 --> 00:23:28,780 information content for the viewer. 504 00:23:28,780 --> 00:23:31,500 And so, those two alternative exists. 505 00:23:31,500 --> 00:23:34,753 Stephen notes that his Zoomer students don't know what a phone book is. 506 00:23:34,753 --> 00:23:37,170 Indeed, this is the reality that we're bumping up against, 507 00:23:37,170 --> 00:23:39,450 and the mod proposes using a hardcover dictionary. 508 00:23:39,450 --> 00:23:42,330 I've not been able to get myself to get comfortable 509 00:23:42,330 --> 00:23:45,720 with the idea of tearing actual books really meant to, 510 00:23:45,720 --> 00:23:48,120 or destined to be recycled anyway. 511 00:23:48,120 --> 00:23:51,450 So I would, perhaps, beware tearing in half something that 512 00:23:51,450 --> 00:23:56,010 might have more impact than something discardable, 513 00:23:56,010 --> 00:23:58,150 annually, like a dictionary. 514 00:23:58,150 --> 00:24:01,770 So this is one that took a colleague of ours some time to build. 515 00:24:01,770 --> 00:24:03,780 And it doesn't need to be this sophisticated, 516 00:24:03,780 --> 00:24:05,940 and indeed, you're about to see a few photos that 517 00:24:05,940 --> 00:24:08,190 are the result of our having collaborated 518 00:24:08,190 --> 00:24:12,210 this past year with a wonderfully talented prop shop 519 00:24:12,210 --> 00:24:14,160 as well as colleagues across campus. 520 00:24:14,160 --> 00:24:16,410 Where we've had the resources and some of the hardware 521 00:24:16,410 --> 00:24:18,450 around with which to build some of these things. 522 00:24:18,450 --> 00:24:20,790 But all of these are born of much simpler ideas. 523 00:24:20,790 --> 00:24:24,360 Before we had some metal and eight light bulbs and electricity like this, 524 00:24:24,360 --> 00:24:26,453 I would just have a few students, three students, 525 00:24:26,453 --> 00:24:29,370 eight students come to the front of the room and hold up their phones, 526 00:24:29,370 --> 00:24:31,230 which generally have flashlights these days. 527 00:24:31,230 --> 00:24:33,720 Or I picked up a few desk lamps for a few dollars 528 00:24:33,720 --> 00:24:35,820 at Target, a local retail store. 529 00:24:35,820 --> 00:24:38,820 So as to represent what we've called here, binary bulbs. 530 00:24:38,820 --> 00:24:42,960 Light bulbs that represent bits or transistors being turned on and off. 531 00:24:42,960 --> 00:24:46,410 And metaphorically being the light bulb, we hope, goes off in students' head 532 00:24:46,410 --> 00:24:47,770 very early in the semester. 533 00:24:47,770 --> 00:24:51,210 And if you've not seen this one before, these are magnetic numbers 534 00:24:51,210 --> 00:24:53,850 that a child might play with on the refrigerator, that 535 00:24:53,850 --> 00:24:56,820 just represent what place each of these light bulbs represents. 536 00:24:56,820 --> 00:25:00,240 The lowest ordered bit on the right, and the highest order bit on the left. 537 00:25:00,240 --> 00:25:04,275 We use this to just have some visual fun talking about binary. 538 00:25:04,275 --> 00:25:06,390 It used turning switches on and off here, 539 00:25:06,390 --> 00:25:08,460 but again, any light bulb suffices. 540 00:25:08,460 --> 00:25:10,650 And then we dramatically, because of the magnets, 541 00:25:10,650 --> 00:25:14,100 have a second student come up typically during this demonstration. 542 00:25:14,100 --> 00:25:17,910 And I then try to dramatically wipe off all of the magnetic letters, 543 00:25:17,910 --> 00:25:19,290 such that they fall on the floor. 544 00:25:19,290 --> 00:25:22,230 And so now, it's like Luke Skywalker mode, 545 00:25:22,230 --> 00:25:26,740 trying to visualize only in their mind's eye what each place represents, 546 00:25:26,740 --> 00:25:28,350 so as to ramp things up. 547 00:25:28,350 --> 00:25:31,860 But here too, even though we might end up spending a few extra minutes 548 00:25:31,860 --> 00:25:35,040 on a demonstration like this, it's a lot more interesting certainly 549 00:25:35,040 --> 00:25:37,080 than going to a chalkboard or a whiteboard 550 00:25:37,080 --> 00:25:39,900 and just jotting down patterns of zeros and ones. 551 00:25:39,900 --> 00:25:43,560 Again, trying to bring the topic to life is the goal of a visual like this. 552 00:25:43,560 --> 00:25:48,120 Whether it's complicated as this build, or as simple as just having students 553 00:25:48,120 --> 00:25:52,200 use their own phones and flashlights. 554 00:25:52,200 --> 00:25:56,580 So this is a larger duck than you might have on your desk at home. 555 00:25:56,580 --> 00:25:58,420 And this is deliberately meant to be, again, 556 00:25:58,420 --> 00:26:02,040 another dramatic visual that is actually incarnated in smaller form. 557 00:26:02,040 --> 00:26:05,460 But Brian, do you want to speak to why there's such a big duck here, 558 00:26:05,460 --> 00:26:08,700 or rather a smaller duck that we tend to hand out to students 559 00:26:08,700 --> 00:26:10,837 back in healthier times here on campus? 560 00:26:10,837 --> 00:26:12,420 BRIAN YU: This is one of my favorites. 561 00:26:12,420 --> 00:26:14,400 This little thing is a duck debugger. 562 00:26:14,400 --> 00:26:17,040 And one of the most common things you have to teach students 563 00:26:17,040 --> 00:26:19,040 when they're first working with computer science 564 00:26:19,040 --> 00:26:20,400 is, how do you debug their code? 565 00:26:20,400 --> 00:26:23,040 Odds are, their programs won't work on the first try. 566 00:26:23,040 --> 00:26:25,290 And there are all sorts of techniques for debugging. 567 00:26:25,290 --> 00:26:27,510 Adding print statements to see what's going on, 568 00:26:27,510 --> 00:26:30,060 we teach students how to use a graphical debugger where 569 00:26:30,060 --> 00:26:31,980 they can step through their code line by line 570 00:26:31,980 --> 00:26:33,900 and look at the values of variables. 571 00:26:33,900 --> 00:26:37,710 But maybe one of the simplest is just using one of these little rubber ducks 572 00:26:37,710 --> 00:26:40,170 and using a technique known as "rubber duck debugging". 573 00:26:40,170 --> 00:26:42,480 Where the student just talks to the duck, 574 00:26:42,480 --> 00:26:45,460 and explains to the duck, what their code is doing 575 00:26:45,460 --> 00:26:47,460 and what they're trying to get their code to do. 576 00:26:47,460 --> 00:26:50,520 And amazingly, even though I wouldn't have thought so at first, 577 00:26:50,520 --> 00:26:54,210 just talking through the problem to the duck is often enough for you 578 00:26:54,210 --> 00:26:57,120 to realize, "Oh, this is exactly what my mistake is." 579 00:26:57,120 --> 00:26:59,730 The act of articulating the problem trying 580 00:26:59,730 --> 00:27:03,817 to explain it from first principles helps you to realize what's gone wrong. 581 00:27:03,817 --> 00:27:06,150 And ultimately, eventually you don't even need the duck. 582 00:27:06,150 --> 00:27:08,610 But especially when you're starting out, just having something 583 00:27:08,610 --> 00:27:10,560 there as a reminder of something you can talk 584 00:27:10,560 --> 00:27:12,660 to as you're working through your problems 585 00:27:12,660 --> 00:27:14,520 can definitely be quite helpful. 586 00:27:14,520 --> 00:27:18,240 And even in CS50 IDE, the online code editor 587 00:27:18,240 --> 00:27:20,670 that we have students use in CS50, there's 588 00:27:20,670 --> 00:27:23,760 a little virtual rubber duck in the upper right hand corner. 589 00:27:23,760 --> 00:27:26,760 So that students can use that as a debugging technique, if they'd like 590 00:27:26,760 --> 00:27:29,265 to try working on debugging their code. 591 00:27:29,265 --> 00:27:31,890 DAVID MALAN: And this is the sort of thing that, it's not free. 592 00:27:31,890 --> 00:27:34,260 And we actually stamp our own name CS50 on the rubber 593 00:27:34,260 --> 00:27:35,430 ducks that we find online. 594 00:27:35,430 --> 00:27:39,030 But I'm actually in a few teacher Facebook groups, where every year 595 00:27:39,030 --> 00:27:41,220 it's fun to see teachers posting online some deal 596 00:27:41,220 --> 00:27:43,410 they found on Amazon for just a few cents each. 597 00:27:43,410 --> 00:27:45,810 Getting a whole bunch, like a bag of these rubber 598 00:27:45,810 --> 00:27:47,830 ducks on sale to present to their students. 599 00:27:47,830 --> 00:27:52,290 So if resources permit, it's a fun way to, again, bring to life some topic 600 00:27:52,290 --> 00:27:55,530 and also genuinely empower students with a technique that 601 00:27:55,530 --> 00:27:56,810 might very well help them. 602 00:27:56,810 --> 00:27:58,560 And frankly, it doesn't need to be a duck. 603 00:27:58,560 --> 00:27:59,730 It can be anything at all. 604 00:27:59,730 --> 00:28:02,110 It can be a picture of a duck that they draw themselves. 605 00:28:02,110 --> 00:28:04,818 So even there, too, there's a range of possibilities that doesn't 606 00:28:04,818 --> 00:28:08,110 need to be a physical thing as well. 607 00:28:08,110 --> 00:28:13,510 So here, this has been a dream of mine for 15+ years to actually talk about 608 00:28:13,510 --> 00:28:14,230 binary search. 609 00:28:14,230 --> 00:28:17,350 Not just with the phone book, but with actual doors. 610 00:28:17,350 --> 00:28:19,970 Since I've long envisioned this idea, this theatricality 611 00:28:19,970 --> 00:28:22,720 of being able to walk in front of a bunch of doors, open the door, 612 00:28:22,720 --> 00:28:25,630 and look behind it to see what number is hidden there. 613 00:28:25,630 --> 00:28:29,350 Toward an end of introducing students to the problem, more generally, of search. 614 00:28:29,350 --> 00:28:31,930 For instance, searching an array of numbers, 615 00:28:31,930 --> 00:28:35,750 and array being applicable to our focus on C early on in the semester. 616 00:28:35,750 --> 00:28:38,140 And by nature of COVID this past year, unfortunately, 617 00:28:38,140 --> 00:28:41,350 not only was most everything shut down, so was one of the local theaters 618 00:28:41,350 --> 00:28:42,490 here in Cambridge. 619 00:28:42,490 --> 00:28:45,820 As the result of which was, that we did have this rare opportunity 620 00:28:45,820 --> 00:28:47,920 to collaborate with their own prop shop. 621 00:28:47,920 --> 00:28:52,330 And so, what you're seeing here is a photograph of eight or so doors 622 00:28:52,330 --> 00:28:54,760 that were just in storage at the back of the theater 623 00:28:54,760 --> 00:28:58,070 that they were able to bring back to the front of the stage. 624 00:28:58,070 --> 00:28:59,870 So as to do a demonstration like this. 625 00:28:59,870 --> 00:29:02,980 And this is not one that, generally, we can do here in healthy times. 626 00:29:02,980 --> 00:29:07,180 Most of us probably don't have access to eight full fledged, human sized doors. 627 00:29:07,180 --> 00:29:11,200 However, those of you who are in high schools or middle schools probably 628 00:29:11,200 --> 00:29:15,680 have a hallway full of lockers or a gymnasium that has something like that. 629 00:29:15,680 --> 00:29:18,040 And so, what we've also done in other times 630 00:29:18,040 --> 00:29:21,310 is actually get a few metal lockers, either on campus 631 00:29:21,310 --> 00:29:23,350 or bring them into the space temporarily. 632 00:29:23,350 --> 00:29:25,930 And being able to use that physical demonstration is 633 00:29:25,930 --> 00:29:28,480 nice in that, when talking about arrays, when 634 00:29:28,480 --> 00:29:32,560 talking about searching behind those arrays, the fact that there 635 00:29:32,560 --> 00:29:34,240 is this physical door-- 636 00:29:34,240 --> 00:29:36,910 especially in the world of C or really any language, 637 00:29:36,910 --> 00:29:40,810 Java included, that supports arrays, makes all the clearer 638 00:29:40,810 --> 00:29:45,063 that a computer can really only look at one of these values at a time. 639 00:29:45,063 --> 00:29:47,980 The problem, of course, being if you just put a whole bunch of numbers 640 00:29:47,980 --> 00:29:50,140 on the stage or in the front of the classroom, 641 00:29:50,140 --> 00:29:53,380 yes, you can say to students that they should only 642 00:29:53,380 --> 00:29:57,400 look at one number at a time when searching for a particular value. 643 00:29:57,400 --> 00:30:00,890 But as humans, we all probably take in everything we're seeing all at once, 644 00:30:00,890 --> 00:30:02,890 and boom, there's the number you're looking for. 645 00:30:02,890 --> 00:30:04,240 Or boom, it's over there. 646 00:30:04,240 --> 00:30:06,220 There's not necessarily the opportunity to do 647 00:30:06,220 --> 00:30:08,440 the mechanics of searching from left to right, 648 00:30:08,440 --> 00:30:11,870 or from right to left, or even binary search in the middle on down. 649 00:30:11,870 --> 00:30:15,290 So using something that physically closes like doors in this one case, 650 00:30:15,290 --> 00:30:17,660 and sadly we won't have access to these anymore. 651 00:30:17,660 --> 00:30:20,770 But-- or lockers, or even paper cups, or something 652 00:30:20,770 --> 00:30:23,470 which you can use to hide something there or not, 653 00:30:23,470 --> 00:30:28,030 we found to be of another very effective visual for students to latch on to. 654 00:30:28,030 --> 00:30:31,300 Brian, meanwhile, did have an opportunity to use some actual numbers. 655 00:30:31,300 --> 00:30:34,282 This time, we didn't use the doors because we 656 00:30:34,282 --> 00:30:36,490 thought it would be way too much opening and closing. 657 00:30:36,490 --> 00:30:38,530 And at this point, we wanted to talk to students 658 00:30:38,530 --> 00:30:42,620 about sorting those very same numbers. 659 00:30:42,620 --> 00:30:45,370 And if you're given a bunch of numbers like these in random order, 660 00:30:45,370 --> 00:30:48,520 these happen to be plastic numbers that we found on Amazon, they even 661 00:30:48,520 --> 00:30:51,702 have little light bulbs if you put in a tiny battery that turn on and off. 662 00:30:51,702 --> 00:30:53,410 But we just wanted some physical numbers. 663 00:30:53,410 --> 00:30:55,280 And in the past, we've done this with sheets of paper, 664 00:30:55,280 --> 00:30:56,980 where we just write the numbers on the board. 665 00:30:56,980 --> 00:30:59,272 Here we wanted to try something a little more physical. 666 00:30:59,272 --> 00:31:03,170 And Brian, do you to explain what you did with these numbers? 667 00:31:03,170 --> 00:31:05,170 BRIAN YU: So the idea of using these numbers was 668 00:31:05,170 --> 00:31:08,800 to visualize what it looks like to perform a sorting algorithm, something 669 00:31:08,800 --> 00:31:12,260 like bubble sort, or selections for example. 670 00:31:12,260 --> 00:31:15,460 And the nice thing about using physical numbers on a shelf 671 00:31:15,460 --> 00:31:18,970 is that it reminds students of a couple of important properties of what 672 00:31:18,970 --> 00:31:21,280 it's really like to sort numbers in an array. 673 00:31:21,280 --> 00:31:23,965 One being, that there's not a whole lot of shelf space here. 674 00:31:23,965 --> 00:31:25,840 So it wouldn't be that easy to take a number, 675 00:31:25,840 --> 00:31:29,810 and squeeze it in between two other numbers without making the space tight. 676 00:31:29,810 --> 00:31:33,370 So if you want to move numbers around, you really need to take one number, 677 00:31:33,370 --> 00:31:35,620 remove it from its place, take another number, 678 00:31:35,620 --> 00:31:39,570 and put it there, for example, to really emphasize that each of these numbers 679 00:31:39,570 --> 00:31:42,280 is in some particular spot inside of an array. 680 00:31:42,280 --> 00:31:45,730 And you can remove something from it, in order to make room for something else. 681 00:31:45,730 --> 00:31:49,035 And the other nice property is that these numbers are, 682 00:31:49,035 --> 00:31:51,160 you have to hold them in order to move them around. 683 00:31:51,160 --> 00:31:54,280 And it's not easy for me, just to pick up all eight of the numbers, 684 00:31:54,280 --> 00:31:56,030 and then put them exactly where I want. 685 00:31:56,030 --> 00:32:00,950 I can really only be working with one or maybe two numbers at any given time. 686 00:32:00,950 --> 00:32:02,800 Which is a good reminder to students as well 687 00:32:02,800 --> 00:32:05,230 that the program can really be working with-- 688 00:32:05,230 --> 00:32:07,820 your program is doing one thing at any given time. 689 00:32:07,820 --> 00:32:10,960 And it's taking a variable, putting some value inside of it, 690 00:32:10,960 --> 00:32:13,550 swapping some value or something like that. 691 00:32:13,550 --> 00:32:15,610 And so, this offers a good way of visualizing 692 00:32:15,610 --> 00:32:18,680 what these algorithms look like, seeing them a little bit more slowly, 693 00:32:18,680 --> 00:32:19,910 step by step. 694 00:32:19,910 --> 00:32:22,210 And I think it's helpful for understanding 695 00:32:22,210 --> 00:32:24,178 how it is that these algorithms work. 696 00:32:24,178 --> 00:32:26,220 DAVID MALAN: For those who missed it in the chat, 697 00:32:26,220 --> 00:32:29,460 shoe boxes were proposed too, as a mechanism for hiding 698 00:32:29,460 --> 00:32:30,810 some value that might be inside. 699 00:32:30,810 --> 00:32:32,440 I like that one as well. 700 00:32:32,440 --> 00:32:34,650 Now in healthier times, this is a photograph 701 00:32:34,650 --> 00:32:37,260 of some students we actually had come up on stage. 702 00:32:37,260 --> 00:32:39,730 Brian was doing that in isolation this past year. 703 00:32:39,730 --> 00:32:41,820 But when we have the opportunity to have students 704 00:32:41,820 --> 00:32:44,460 come to the front of the class, we have in some semesters just 705 00:32:44,460 --> 00:32:45,918 handed them those physical numbers. 706 00:32:45,918 --> 00:32:49,470 Either the plastic numbers here, or just print outs in very bold fonts. 707 00:32:49,470 --> 00:32:54,360 So that it's clear to the students sitting down, 708 00:32:54,360 --> 00:32:56,280 what numbers the students are holding. 709 00:32:56,280 --> 00:33:00,150 And here too, it's a nice visual in that there's a lot of movement. 710 00:33:00,150 --> 00:33:04,170 And the fact that it is so expensive to keep walking back and forth, 711 00:33:04,170 --> 00:33:06,360 moving these numbers around, rather sets in. 712 00:33:06,360 --> 00:33:09,008 The downside of using humans and students 713 00:33:09,008 --> 00:33:10,800 for these kinds of demonstrations, this is, 714 00:33:10,800 --> 00:33:13,690 that I do think it's also a little harder for the audience. 715 00:33:13,690 --> 00:33:17,730 Especially if they're not 100% following along with this new topic, like bubble 716 00:33:17,730 --> 00:33:21,990 sort, or selection, or the like to understand what's going on, 717 00:33:21,990 --> 00:33:23,530 because it's a little sloppy. 718 00:33:23,530 --> 00:33:27,540 And so, I would keep that in mind any time you do use human participants. 719 00:33:27,540 --> 00:33:30,490 And that the demonstration might not very well go according to plan. 720 00:33:30,490 --> 00:33:33,720 And that's fine too, if it's just meant to be a memorable moment that you 721 00:33:33,720 --> 00:33:35,665 can then come back to again and again. 722 00:33:35,665 --> 00:33:38,790 But there's something to be said too, I think, for the cleanliness of doing 723 00:33:38,790 --> 00:33:41,320 it yourself, or as Brian did it, alone. 724 00:33:41,320 --> 00:33:44,920 So that you can really choreograph things and get it just right. 725 00:33:44,920 --> 00:33:48,510 But there's perhaps a nice balance between those two. 726 00:33:48,510 --> 00:33:50,640 Some of you might have seen the videos online of, 727 00:33:50,640 --> 00:33:54,150 I think it's a Hungarian dance group does something for bubble sort, 728 00:33:54,150 --> 00:33:56,340 and selection sort, and insertion sort and others. 729 00:33:56,340 --> 00:33:58,950 And those are fun too, but they're rather for the viewer 730 00:33:58,950 --> 00:34:00,600 that already knows what's going on. 731 00:34:00,600 --> 00:34:02,517 Because there's a lot more spinning than there 732 00:34:02,517 --> 00:34:06,220 needs to be, for instance, in a typical sorting algorithm. 733 00:34:06,220 --> 00:34:08,670 So this is a fun one that can happen very early 734 00:34:08,670 --> 00:34:12,630 on in the semester, whether using C or any language, when it comes time 735 00:34:12,630 --> 00:34:16,020 to just talk about variables, and assigning values to variables, 736 00:34:16,020 --> 00:34:17,460 and swapping values. 737 00:34:17,460 --> 00:34:19,830 And we introduced this a few weeks in, if only 738 00:34:19,830 --> 00:34:23,060 because a lot of these algorithms we just talked about-- 739 00:34:23,060 --> 00:34:24,810 selection sort, bubble sort, and the like, 740 00:34:24,810 --> 00:34:28,830 generally involves swapping the locations of two things in memory. 741 00:34:28,830 --> 00:34:32,010 Now in Python, you can do this with one line of code 742 00:34:32,010 --> 00:34:33,900 that just magically swaps two things. 743 00:34:33,900 --> 00:34:37,679 In most languages, you need to be a little more pedantic unless you resort 744 00:34:37,679 --> 00:34:39,670 to bitwise operators and the like. 745 00:34:39,670 --> 00:34:42,179 And you need generally a temporary variable. 746 00:34:42,179 --> 00:34:46,560 And so, Brian, when you did this, this year, what was your goal? 747 00:34:46,560 --> 00:34:50,190 BRIAN YU: So the question we asked the students is, how would you change 748 00:34:50,190 --> 00:34:52,020 which glass contains which liquid? 749 00:34:52,020 --> 00:34:55,090 Like get the glass on the left to contain the blue liquid instead. 750 00:34:55,090 --> 00:34:58,140 And get the glass on the right to contain the red liquid. 751 00:34:58,140 --> 00:35:02,370 And most of the students were able to pretty quickly come up 752 00:35:02,370 --> 00:35:05,250 with the realization that if you just have these two glasses, 753 00:35:05,250 --> 00:35:06,750 you can't quite do that. 754 00:35:06,750 --> 00:35:08,910 And that the solution is to use a third glass. 755 00:35:08,910 --> 00:35:12,600 You pour the red liquid maybe into the third empty glass. 756 00:35:12,600 --> 00:35:15,240 And now, you have room to take the blue liquid, 757 00:35:15,240 --> 00:35:17,760 put it into the glass that used to hold the red liquid, 758 00:35:17,760 --> 00:35:21,910 and then transfer the red liquid into the new glass as well. 759 00:35:21,910 --> 00:35:25,140 And this is always a great demonstration because if you just gave students 760 00:35:25,140 --> 00:35:28,020 two variables, an integer called X and an integer 761 00:35:28,020 --> 00:35:32,220 called Y, and told them to swap them, most won't immediately 762 00:35:32,220 --> 00:35:34,530 come up with exactly what the right lines of code 763 00:35:34,530 --> 00:35:36,720 are to perform that swapping procedure. 764 00:35:36,720 --> 00:35:39,150 But introducing this demo first, most students 765 00:35:39,150 --> 00:35:42,630 figure out the logic very quickly of being able to see the actual liquid, 766 00:35:42,630 --> 00:35:46,170 seeing how they need to be poured into other glasses to get them to swap, 767 00:35:46,170 --> 00:35:49,480 and then you can translate that back into what the original C 768 00:35:49,480 --> 00:35:50,407 code looks like. 769 00:35:50,407 --> 00:35:52,740 DAVID MALAN: And when it's an actual student doing this, 770 00:35:52,740 --> 00:35:55,020 I mean, we deliberately only give them two glasses. 771 00:35:55,020 --> 00:35:56,790 We ask them to swap the two values. 772 00:35:56,790 --> 00:35:59,400 And then, there's the sort of awkward moment 773 00:35:59,400 --> 00:36:02,797 where they realize this is not really going to be easy or even possible. 774 00:36:02,797 --> 00:36:05,130 At which point, you can whip out the temporary variable, 775 00:36:05,130 --> 00:36:06,990 the third glass in the story. 776 00:36:06,990 --> 00:36:10,350 When it's, for instance, the student and not just the teacher or Brian. 777 00:36:10,350 --> 00:36:13,290 Just to now give you a taste of some of the other visuals 778 00:36:13,290 --> 00:36:14,520 we've used in recent years. 779 00:36:14,520 --> 00:36:17,970 We found an old spare mailbox that we've used as a metaphor 780 00:36:17,970 --> 00:36:22,230 to talk about addresses in the context of C, and how every location in memory 781 00:36:22,230 --> 00:36:24,180 indeed has an address of some sort. 782 00:36:24,180 --> 00:36:27,030 We use this as an opportunity to talk briefly about hexadecimal, 783 00:36:27,030 --> 00:36:28,815 if only because they're going to see zero 784 00:36:28,815 --> 00:36:33,900 X dot dot dot in a bunch of context like the debugger, or perhaps other tools. 785 00:36:33,900 --> 00:36:34,983 And that's a fun metaphor. 786 00:36:34,983 --> 00:36:37,983 And even if this isn't something to bring to the front of the classroom, 787 00:36:37,983 --> 00:36:40,680 you could imagine doing a little skit on video, even in advance, 788 00:36:40,680 --> 00:36:44,220 using one's own neighborhood and mailboxes along the street. 789 00:36:44,220 --> 00:36:46,470 We do use a dictionary toward the end of the semester. 790 00:36:46,470 --> 00:36:51,180 Not for the tearing example, but to talk about dictionaries with key value pairs 791 00:36:51,180 --> 00:36:53,790 and hash tables underneath the hood. 792 00:36:53,790 --> 00:36:56,580 And this, honestly, doesn't serve much more function other than, 793 00:36:56,580 --> 00:36:58,295 "hey all, here's a dictionary." 794 00:36:58,295 --> 00:36:59,670 This is what we're talking about. 795 00:36:59,670 --> 00:37:04,050 Just again, to put a visual on the stage or in the front of the classroom 796 00:37:04,050 --> 00:37:06,180 so that students again have like a visual 797 00:37:06,180 --> 00:37:11,280 to latch onto when thinking about or revisiting an otherwise arcane topic. 798 00:37:11,280 --> 00:37:15,450 This, too, was a side effect of having access to a whole prop shop. 799 00:37:15,450 --> 00:37:18,755 We, for the first time in 15 years, had access to an actual refrigerator 800 00:37:18,755 --> 00:37:21,130 that we were able to bring out to the front of the class. 801 00:37:21,130 --> 00:37:24,990 And we use this to talk about locking and race conditions 802 00:37:24,990 --> 00:37:26,220 in the context of SQL. 803 00:37:26,220 --> 00:37:29,580 Long story, short, there are certain challenges in computing 804 00:37:29,580 --> 00:37:32,220 whenever you have multiple threads or multiple users trying 805 00:37:32,220 --> 00:37:34,348 to do things at roughly the same time. 806 00:37:34,348 --> 00:37:37,140 Bad things can happen if two different users, two different threads 807 00:37:37,140 --> 00:37:39,010 are trying to access the same value. 808 00:37:39,010 --> 00:37:41,760 And the way I learned about race conditions back in the day 809 00:37:41,760 --> 00:37:44,550 is in the context of a refrigerator and opening it 810 00:37:44,550 --> 00:37:49,000 up, checking to see if you have some milk in the fridge. 811 00:37:49,000 --> 00:37:52,290 And if not, you walk off to the store, and you go and buy some milk. 812 00:37:52,290 --> 00:37:55,290 But problem arises if another family member or roommate 813 00:37:55,290 --> 00:37:59,730 follows you and opens the door after you've left, sees that there's no milk, 814 00:37:59,730 --> 00:38:01,645 and then tries to go to the store as well. 815 00:38:01,645 --> 00:38:03,520 And then, you end up with twice as much milk. 816 00:38:03,520 --> 00:38:06,810 So in this case, we actually, and you can just see it on the floor there. 817 00:38:06,810 --> 00:38:10,590 We actually locked the thing physically with the padlock and a chain 818 00:38:10,590 --> 00:38:15,820 just to bring to life that very low level topic for students as well. 819 00:38:15,820 --> 00:38:19,920 This could certainly be achieved with a camera in your own kitchen, 820 00:38:19,920 --> 00:38:21,660 just to make that same point. 821 00:38:21,660 --> 00:38:23,010 We talk about cookies. 822 00:38:23,010 --> 00:38:26,200 This is just an excuse to have cookies for the team toward the end of class 823 00:38:26,200 --> 00:38:26,700 here. 824 00:38:26,700 --> 00:38:30,540 But when talking about cookies in the context of HTTP and a shopping cart, 825 00:38:30,540 --> 00:38:32,460 turns out if you have a local theater, they 826 00:38:32,460 --> 00:38:35,700 might very well have an old shopping cart that we used to talk about state. 827 00:38:35,700 --> 00:38:37,950 And to talk about how cookies can be used 828 00:38:37,950 --> 00:38:41,280 to create the illusion of sessions, the maintenance of state 829 00:38:41,280 --> 00:38:44,590 across an otherwise stateless protocol like HTTP. 830 00:38:44,590 --> 00:38:47,640 So again, just another memorable moment that we tried to create. 831 00:38:47,640 --> 00:38:50,640 And then this one too, is meant to be, this happens to be an old phone 832 00:38:50,640 --> 00:38:53,400 but you could do it with any phone in the context of JavaScript 833 00:38:53,400 --> 00:38:55,680 asynchronous functions and callbacks. 834 00:38:55,680 --> 00:38:57,630 Whereby you call the function, and you want 835 00:38:57,630 --> 00:39:01,278 it to call another function when it has your return value essentially. 836 00:39:01,278 --> 00:39:04,320 Brian and I have started doing a little skit in the past couple of years. 837 00:39:04,320 --> 00:39:08,317 Where I call him on stage, and then I ask him a question 838 00:39:08,317 --> 00:39:10,650 that he needs a little bit of time to get the answer to. 839 00:39:10,650 --> 00:39:14,440 So we hang up, I continue the class, and then a few seconds, minutes later, 840 00:39:14,440 --> 00:39:16,980 the phone rings with my callback. 841 00:39:16,980 --> 00:39:19,433 At which point, he has the answer to my question. 842 00:39:19,433 --> 00:39:21,600 So a fun little skit too, that can be done certainly 843 00:39:21,600 --> 00:39:25,560 with a couple of cell phones in one's pockets. 844 00:39:25,560 --> 00:39:29,340 SPEAKER 1: In this pandemic, where we have to work from home 845 00:39:29,340 --> 00:39:35,910 and teach for home, have you used some digital tools to substitute 846 00:39:35,910 --> 00:39:37,830 to this physical one? 847 00:39:37,830 --> 00:39:41,073 To exemplify that your show? 848 00:39:41,073 --> 00:39:42,490 DAVID MALAN: It's a good question. 849 00:39:42,490 --> 00:39:43,620 I did not. 850 00:39:43,620 --> 00:39:47,940 I had the fortune to be able to continue teaching on campus this fall. 851 00:39:47,940 --> 00:39:50,700 No students were here, but we were in fact in this space. 852 00:39:50,700 --> 00:39:53,670 But let me invite the group, if most everyone here was indeed 853 00:39:53,670 --> 00:39:56,010 teaching online or hybrid in some form this year, 854 00:39:56,010 --> 00:39:58,710 please do feel free to volunteer via the chat-- 855 00:39:58,710 --> 00:40:01,740 inspirations you might have had using your own refrigerator, 856 00:40:01,740 --> 00:40:05,160 or glasses in the cupboard, or anything along those lines. 857 00:40:05,160 --> 00:40:09,210 Since all of us did have to get creative in some form. 858 00:40:09,210 --> 00:40:11,100 And now, as for the course's problem sets. 859 00:40:11,100 --> 00:40:12,900 Wanted to touch on a couple of final notes 860 00:40:12,900 --> 00:40:17,590 here this morning to give folks a sense of the intent of the problem sets. 861 00:40:17,590 --> 00:40:21,270 Which ultimately are meant to be very domain inspired. 862 00:40:21,270 --> 00:40:24,300 They're meant to be more puzzle like than they 863 00:40:24,300 --> 00:40:29,040 are meant to be the more traditional end of a chapter in a textbook problems. 864 00:40:29,040 --> 00:40:33,150 That just has you implement a very small, very well defined problem 865 00:40:33,150 --> 00:40:35,310 like implement a function that takes two arguments 866 00:40:35,310 --> 00:40:37,110 and return the sum of those two. 867 00:40:37,110 --> 00:40:41,440 Useful practice and good reinforcement for muscle memory, 868 00:40:41,440 --> 00:40:45,660 but generally speaking for CS50's own problem sets or weekly projects, 869 00:40:45,660 --> 00:40:49,680 the intent for us has long been to take some inspiration from a real world 870 00:40:49,680 --> 00:40:50,650 problem. 871 00:40:50,650 --> 00:40:53,550 And even if at the end of the day, the tools students need to solve 872 00:40:53,550 --> 00:40:57,540 it are pretty mundane like use a loop, or use some variables, 873 00:40:57,540 --> 00:40:59,440 or some other feature of the language. 874 00:40:59,440 --> 00:41:03,550 We want them to approach the problem with a much more alluring packaging 875 00:41:03,550 --> 00:41:04,050 to it. 876 00:41:04,050 --> 00:41:06,335 A much more alluring context. 877 00:41:06,335 --> 00:41:08,460 So that they actually see the forest for the trees. 878 00:41:08,460 --> 00:41:12,000 And Brian, do you want to just rattle off some of the domains 879 00:41:12,000 --> 00:41:14,438 that we've used successfully here? 880 00:41:14,438 --> 00:41:16,230 BRIAN YU: One of the big goals has been to, 881 00:41:16,230 --> 00:41:19,080 since many students have never really seen computer science before, 882 00:41:19,080 --> 00:41:21,420 to really emphasize how much computer science can 883 00:41:21,420 --> 00:41:25,120 be connected to whatever it is that students are already interested in. 884 00:41:25,120 --> 00:41:27,150 So if they're already interested in games, 885 00:41:27,150 --> 00:41:29,490 there's a very early problem set where students 886 00:41:29,490 --> 00:41:33,880 are building a pyramid as though it were from the Super Mario Bros video game. 887 00:41:33,880 --> 00:41:35,880 And so, they see the connection there. 888 00:41:35,880 --> 00:41:38,430 For students that are maybe interested in science, 889 00:41:38,430 --> 00:41:42,210 we've recently introduced more science based problem sets where they're 890 00:41:42,210 --> 00:41:45,870 looking at DNA sequences, and DNA sequences can really just 891 00:41:45,870 --> 00:41:48,010 be treated as a string of text. 892 00:41:48,010 --> 00:41:50,220 And so, all of the opportunities for working 893 00:41:50,220 --> 00:41:53,230 with problems that are manipulating strings of text, 894 00:41:53,230 --> 00:41:57,210 we can then apply to those sorts of biology inspired problems. 895 00:41:57,210 --> 00:42:01,800 We can also apply them to problems inspired by literature, taking examples 896 00:42:01,800 --> 00:42:04,440 from books from various different grade levels, 897 00:42:04,440 --> 00:42:09,210 and assessing how difficult those books might be to read all programmatically. 898 00:42:09,210 --> 00:42:12,413 And we've taken inspiration from software 899 00:42:12,413 --> 00:42:15,330 that students are using, apps that they're often using on their phone. 900 00:42:15,330 --> 00:42:18,690 Especially the filters that apps like Instagram or Snapchat 901 00:42:18,690 --> 00:42:20,880 might be quite popular nowadays. 902 00:42:20,880 --> 00:42:24,270 And so we ask students when we introduce files and images, 903 00:42:24,270 --> 00:42:26,610 to try building some of those filters for themselves. 904 00:42:26,610 --> 00:42:29,490 Writing filters to apply various different changes 905 00:42:29,490 --> 00:42:32,470 to existing images too. 906 00:42:32,470 --> 00:42:35,880 We explore the world of cryptography and figuring out 907 00:42:35,880 --> 00:42:39,358 how to encrypt and decrypt information in order to send secret messages. 908 00:42:39,358 --> 00:42:42,150 And ultimately, just trying to come up with these sorts of problems 909 00:42:42,150 --> 00:42:44,550 that students will see the practical value of it, 910 00:42:44,550 --> 00:42:46,030 and hopefully be excited by it. 911 00:42:46,030 --> 00:42:48,420 So that the problem domain is interesting, 912 00:42:48,420 --> 00:42:51,150 and they're therefore able to really get engaged with the code 913 00:42:51,150 --> 00:42:52,287 that they're writing to. 914 00:42:52,287 --> 00:42:54,620 DAVID MALAN: And for what it's worth, the approach we've 915 00:42:54,620 --> 00:42:57,110 taken over the years to finding problems like this, 916 00:42:57,110 --> 00:43:00,140 is just to keep a passive eye and ear out over time. 917 00:43:00,140 --> 00:43:04,160 When we see some interesting blog post online about some new technology, 918 00:43:04,160 --> 00:43:08,240 we start to think about how to distill that seemingly complicated technology 919 00:43:08,240 --> 00:43:09,290 into its essence. 920 00:43:09,290 --> 00:43:12,560 For instance, like file recovery in the forensics example that Brian gave. 921 00:43:12,560 --> 00:43:16,393 Or if we aren't ourselves familiar with some field, 922 00:43:16,393 --> 00:43:18,560 for instance, the extent of my background in biology 923 00:43:18,560 --> 00:43:20,870 is from ninth grade in high school and that's it. 924 00:43:20,870 --> 00:43:23,870 Thankfully, Brian has a little bit more of a background 925 00:43:23,870 --> 00:43:27,280 and was able to create our more genetically inspired problems most 926 00:43:27,280 --> 00:43:27,780 recently. 927 00:43:27,780 --> 00:43:30,140 So that, even we are learning something along the way. 928 00:43:30,140 --> 00:43:32,510 The upside of which is, that we need to wrap 929 00:43:32,510 --> 00:43:34,550 our minds around a complicated topic and then 930 00:43:34,550 --> 00:43:38,450 again distill it into something simplified for students. 931 00:43:38,450 --> 00:43:41,420 But just so that they start to see the connections of computer science 932 00:43:41,420 --> 00:43:43,525 and programming to these other worlds. 933 00:43:43,525 --> 00:43:45,650 As an aside, we see a whole bunch of questions that 934 00:43:45,650 --> 00:43:46,790 have been flying across the screen. 935 00:43:46,790 --> 00:43:49,080 We're taking notes on all of the chat questions. 936 00:43:49,080 --> 00:43:54,350 So even if we don't touch them all live here, we'll follow up in some form, 937 00:43:54,350 --> 00:43:57,350 so as to not leave those unaddressed. 938 00:43:57,350 --> 00:44:00,080 So in closing here, there's a few things we 939 00:44:00,080 --> 00:44:03,050 wanted to touch on as well as to the events that we've done here. 940 00:44:03,050 --> 00:44:05,780 At least in healthier times, CS50 has been 941 00:44:05,780 --> 00:44:09,170 punctuated at the beginning, the middle, and the end of the semester 942 00:44:09,170 --> 00:44:13,190 by way of events that we've brought online over time. 943 00:44:13,190 --> 00:44:15,940 We didn't start the course this way, but each time over the years, 944 00:44:15,940 --> 00:44:18,357 did we try to introduce a little something new to see what 945 00:44:18,357 --> 00:44:20,060 sticks and resonates with students. 946 00:44:20,060 --> 00:44:22,550 For instance, years ago, we wanted to send the message 947 00:44:22,550 --> 00:44:26,390 very early on in the course, before it begins practically, 948 00:44:26,390 --> 00:44:29,360 that computer science is not about programming per se. 949 00:44:29,360 --> 00:44:32,450 And even though that's the mental model that many students have, 950 00:44:32,450 --> 00:44:35,360 particularly given how it's structured in lower grade levels, 951 00:44:35,360 --> 00:44:39,140 that it's programming-- we want them to there see that it's not 952 00:44:39,140 --> 00:44:42,080 just what their friends have been doing, middle school or high school, 953 00:44:42,080 --> 00:44:44,960 it's really about problem solving more generally. 954 00:44:44,960 --> 00:44:47,630 And indeed, once you get to college, at least in our case, 955 00:44:47,630 --> 00:44:49,520 are there are just so many other directions 956 00:44:49,520 --> 00:44:50,952 that you can typically go in. 957 00:44:50,952 --> 00:44:53,660 And we want to give students a taste of those various directions, 958 00:44:53,660 --> 00:44:57,980 but not by focusing on code and on programming per se, 959 00:44:57,980 --> 00:45:00,380 but on taking input and producing output. 960 00:45:00,380 --> 00:45:01,710 Ergo solving problems. 961 00:45:01,710 --> 00:45:05,000 So CS50 Puzzle Day is something we've done for years with some alumni 962 00:45:05,000 --> 00:45:06,050 and friends at Facebook. 963 00:45:06,050 --> 00:45:09,830 We're really good at writing these riddles and puzzles, mental puzzles not 964 00:45:09,830 --> 00:45:10,790 physical ones. 965 00:45:10,790 --> 00:45:14,330 And we print out a PDF of puzzles at the start of the semester, 966 00:45:14,330 --> 00:45:17,637 we typically gather a few hundred students in our case. 967 00:45:17,637 --> 00:45:19,970 And then, we make these same puzzles available to anyone 968 00:45:19,970 --> 00:45:23,430 online, taking or teaching CS50x or CS50 AP. 969 00:45:23,430 --> 00:45:27,320 So as to have a lot of these same events localized in a local school, 970 00:45:27,320 --> 00:45:29,180 non-profit, or community, or the like. 971 00:45:29,180 --> 00:45:32,600 To really just get students excited at the very beginning of the experience 972 00:45:32,600 --> 00:45:34,350 about solving problems. 973 00:45:34,350 --> 00:45:38,090 Toward the end of the semester, have we typically done a CS50 hackathon. 974 00:45:38,090 --> 00:45:39,980 This too, is inspired by a tradition that 975 00:45:39,980 --> 00:45:42,510 rather began in tech it would seem. 976 00:45:42,510 --> 00:45:47,960 But we gather in our case at 7:00 PM, and stay until 7:00 AM, 977 00:45:47,960 --> 00:45:50,630 working throughout the night, which is not a time frame that 978 00:45:50,630 --> 00:45:52,260 works well for all grade levels. 979 00:45:52,260 --> 00:45:54,680 So we've also adapted this idea over the years, 980 00:45:54,680 --> 00:45:57,380 we held a hackathon in Manhattan a few years ago 981 00:45:57,380 --> 00:46:00,380 with a few public and a few private schools for an AP audience. 982 00:46:00,380 --> 00:46:04,550 Focusing in that demographic on, I think, 10 AM to 3 PM. 983 00:46:04,550 --> 00:46:07,970 And here I was thinking that 10 AM was the ungodly hour on the weekend. 984 00:46:07,970 --> 00:46:11,430 But we adapted for the different demographics as well. 985 00:46:11,430 --> 00:46:13,400 And so, this is an opportunity in our case 986 00:46:13,400 --> 00:46:16,850 to either have students focus on one of the course's problem sets, 987 00:46:16,850 --> 00:46:19,700 or some other programming project, or their own final project 988 00:46:19,700 --> 00:46:23,000 depending on where in the school year or the semester it falls. 989 00:46:23,000 --> 00:46:27,410 And it's just an opportunity to normalize and socialize, 990 00:46:27,410 --> 00:46:28,940 what is effectively homework. 991 00:46:28,940 --> 00:46:32,150 But in a way that makes it feel like a shared experience, and hopefully 992 00:46:32,150 --> 00:46:35,840 a memorable moment in their middle school, high school or in our case, 993 00:46:35,840 --> 00:46:37,250 college career. 994 00:46:37,250 --> 00:46:39,140 And then lastly, is the CS50 fair. 995 00:46:39,140 --> 00:46:42,350 And Brian, do you want to speak to exactly what happens at the CS50 fair? 996 00:46:42,350 --> 00:46:46,207 Whether on a small scale with one class, or a large scale on campus? 997 00:46:46,207 --> 00:46:48,290 BRIAN YU: This is maybe my favorite of the events. 998 00:46:48,290 --> 00:46:50,570 CS50 students typically at the end of the class 999 00:46:50,570 --> 00:46:52,580 work on a final project of their own choosing. 1000 00:46:52,580 --> 00:46:55,910 Where they get to decide on something they're interested in, 1001 00:46:55,910 --> 00:46:59,000 and have the opportunity to showcase it to others at the fair. 1002 00:46:59,000 --> 00:47:02,060 And so, we usually set up some tables where students just 1003 00:47:02,060 --> 00:47:03,270 bring their computer. 1004 00:47:03,270 --> 00:47:06,740 And we invite other teachers and students 1005 00:47:06,740 --> 00:47:09,860 from around the university to come visit, and students from other schools 1006 00:47:09,860 --> 00:47:10,430 as well. 1007 00:47:10,430 --> 00:47:12,710 Just to come walk around and talk to the students 1008 00:47:12,710 --> 00:47:14,653 and see what projects that they've created. 1009 00:47:14,653 --> 00:47:16,820 And it's a really great opportunity for the students 1010 00:47:16,820 --> 00:47:20,000 to have the chance to showcase what they've been working so hard on. 1011 00:47:20,000 --> 00:47:22,130 And it's always inspiring as a spectator, just 1012 00:47:22,130 --> 00:47:25,705 to go around and see all of the amazing work that students have been doing. 1013 00:47:25,705 --> 00:47:28,080 DAVID MALAN: Well, I want to be mindful of the time here. 1014 00:47:28,080 --> 00:47:31,400 So in a moment, let me turn things back over to Carter and to Bernie 1015 00:47:31,400 --> 00:47:34,400 to give you a sense of what more comes today and tomorrow. 1016 00:47:34,400 --> 00:47:38,000 Brian and I and the team will be popping out and in of the sessions 1017 00:47:38,000 --> 00:47:38,990 today and tomorrow. 1018 00:47:38,990 --> 00:47:41,510 And by all means, always reach out via email this weekend 1019 00:47:41,510 --> 00:47:42,950 or beyond if you have questions. 1020 00:47:42,950 --> 00:47:46,470 And for the chat questions we didn't get to hear during the hour, 1021 00:47:46,470 --> 00:47:50,390 we will follow up on as many of those as we can via email after this. 1022 00:47:50,390 --> 00:47:53,680 But thank you, and Carter, back to you. 1023 00:47:53,680 --> 00:47:55,000