1 00:00:00,000 --> 00:00:00,690 2 00:00:00,690 --> 00:00:05,040 DAVID MALAN: --between two persons, A and B. So before 3 00:00:05,040 --> 00:00:06,570 we transition to that new world. 4 00:00:06,570 --> 00:00:08,945 DOUG LLOYD: So I see on the table there just a second ago 5 00:00:08,945 --> 00:00:11,840 the cousin of our friend here watching the video with us. 6 00:00:11,840 --> 00:00:14,230 DAVID MALAN: Yeah, well this is our duck debugger. 7 00:00:14,230 --> 00:00:17,160 DDB50, perhaps one of the most clever we've ever done. 8 00:00:17,160 --> 00:00:20,675 9 00:00:20,675 --> 00:00:22,800 DOUG LLOYD: And what exactly is this duck here for? 10 00:00:22,800 --> 00:00:24,800 DAVID MALAN: So, turns out rubber duck debugging 11 00:00:24,800 --> 00:00:29,520 is kind of a thing, such that some people in the absence of other humans 12 00:00:29,520 --> 00:00:32,400 to talk to, will pick some inanimate object, 13 00:00:32,400 --> 00:00:35,890 and somehow it became a rubber duck because the duck will not judge you, 14 00:00:35,890 --> 00:00:38,910 it will not criticize you, you can talk to the duck 15 00:00:38,910 --> 00:00:43,140 and explain to the duck, or really anything or anyone, what you think 16 00:00:43,140 --> 00:00:45,090 or what you hope your code is actually doing. 17 00:00:45,090 --> 00:00:49,110 And it's really meant to be not just a catharsis, but also an opportunity 18 00:00:49,110 --> 00:00:52,090 to hear yourself talking through your own code at which point, 19 00:00:52,090 --> 00:00:55,710 hopefully you have your own self-induced aha moment when you realize 20 00:00:55,710 --> 00:00:59,340 your code actually doesn't do what you are saying it's supposed to do 21 00:00:59,340 --> 00:01:02,625 or vice versa, you realize that you're describing it incorrectly all together. 22 00:01:02,625 --> 00:01:05,250 DOUG LLOYD: Right, because the duck's not going to nod its head 23 00:01:05,250 --> 00:01:07,720 and say, OK, yeah, I get what you're talking about. 24 00:01:07,720 --> 00:01:09,346 You have to actually pick every line. 25 00:01:09,346 --> 00:01:11,970 DAVID MALAN: Yeah, so we've gotten a non-zero number of reports 26 00:01:11,970 --> 00:01:14,060 of CS50 students who now have these in their dorm rooms 27 00:01:14,060 --> 00:01:16,910 saying that they're debugging their code by way of talking it through to a duck. 28 00:01:16,910 --> 00:01:19,050 And you know, it's funny, it's a silly thing 29 00:01:19,050 --> 00:01:22,710 and it was really just a way of coming up 30 00:01:22,710 --> 00:01:25,600 with an excuse for having what is an eight-foot duck on the screen 31 00:01:25,600 --> 00:01:28,890 in this lecture, eventually, that AJ kindly snuck 32 00:01:28,890 --> 00:01:33,510 onto the stage, or [? Colten, ?] but it's kind of true. 33 00:01:33,510 --> 00:01:36,390 I've actually found and been frustrated by myself when 34 00:01:36,390 --> 00:01:39,600 I've been wrestling with some bug or some design of some computer program, 35 00:01:39,600 --> 00:01:42,030 not just for CS50 per se, but more generally, 36 00:01:42,030 --> 00:01:45,780 and then finally a colleague walks by and say, 37 00:01:45,780 --> 00:01:47,740 hey can I bounce some ideas off of. 38 00:01:47,740 --> 00:01:51,360 And it's just so incredibly helpful and revealing 39 00:01:51,360 --> 00:01:53,820 to actually talks through something with someone else. 40 00:01:53,820 --> 00:01:56,450 I mean I'm actually feeling this way right now with this. 41 00:01:56,450 --> 00:01:59,877 I'm really understanding now what CS50 explained is all about. 42 00:01:59,877 --> 00:02:01,710 But you hear yourself speak and it gives you 43 00:02:01,710 --> 00:02:03,710 a chance to kind of clean up what you're saying, 44 00:02:03,710 --> 00:02:05,880 because while it might be all messy in your head, 45 00:02:05,880 --> 00:02:09,914 you have to verbalize it and clean it up at which point you find the faults. 46 00:02:09,914 --> 00:02:13,080 DOUG LLOYD: Right, but this is not the only debugging strategy that we have. 47 00:02:13,080 --> 00:02:15,890 We have the in-person debugging strategy, 48 00:02:15,890 --> 00:02:19,586 but we also decided to tackle the debugging problem, which 49 00:02:19,586 --> 00:02:21,710 is a longstanding problem of how to teach debugging 50 00:02:21,710 --> 00:02:25,690 and how to do it effectively, with the Debug50, the improving 51 00:02:25,690 --> 00:02:27,780 of our graphical debugger from 2015. 52 00:02:27,780 --> 00:02:30,210 DAVID MALAN: Thanks to Dan [INAUDIBLE], [? Karim, ?] 53 00:02:30,210 --> 00:02:35,790 who have contributed so much now to the CS50 inspired graphical debugger that's 54 00:02:35,790 --> 00:02:38,539 built on top of Cloud9, but is GDB specific. 55 00:02:38,539 --> 00:02:41,580 The GNU debugger that we've long used in CS50, operated in a command line 56 00:02:41,580 --> 00:02:42,701 environment. 57 00:02:42,701 --> 00:02:43,200 It's nice. 58 00:02:43,200 --> 00:02:45,690 I mean GDB is an incredibly powerful tool, 59 00:02:45,690 --> 00:02:48,370 but so hard to use for so many people, in part just because-- 60 00:02:48,370 --> 00:02:49,620 DOUG LLOYD: And hard to teach. 61 00:02:49,620 --> 00:02:52,328 DAVID MALAN: Hard to teach, and in part just because it comingles 62 00:02:52,328 --> 00:02:54,660 its output with the program's output and the commands 63 00:02:54,660 --> 00:02:58,274 themselves are pretty arcane, you don't necessarily just see data constantly, 64 00:02:58,274 --> 00:03:00,690 you have to type the commands with which to see that data, 65 00:03:00,690 --> 00:03:03,360 and just a lot of steps get in the way, a lot of mechanics 66 00:03:03,360 --> 00:03:05,292 get in the way of the debugging ideas. 67 00:03:05,292 --> 00:03:06,000 And so it's nice. 68 00:03:06,000 --> 00:03:08,670 I mean in CS50 IDE now, thanks to the debugger, 69 00:03:08,670 --> 00:03:11,490 you can just constantly see the current stack frames 70 00:03:11,490 --> 00:03:13,475 and the current state of your stack. 71 00:03:13,475 --> 00:03:16,350 You can see all the local variables, you can set breakpoints and step 72 00:03:16,350 --> 00:03:18,058 through it, and so it allows you to focus 73 00:03:18,058 --> 00:03:22,140 on exactly the same ideas of debugging, but without the textual or syntactic 74 00:03:22,140 --> 00:03:25,620 distractions, much like the reasoning behind our use of Scratch 75 00:03:25,620 --> 00:03:28,410 initially before we switch to C. 76 00:03:28,410 --> 00:03:29,526 DOUG LLOYD: Right. 77 00:03:29,526 --> 00:03:32,940 We definitely saw a lot of this at office hours this year. 78 00:03:32,940 --> 00:03:37,960 Students really getting right into the weeds of debugging and getting 79 00:03:37,960 --> 00:03:41,250 their handle on Debug50, but there was one other tool 80 00:03:41,250 --> 00:03:44,520 that we consciously spent a lot of time working on this summer in particular. 81 00:03:44,520 --> 00:03:49,170 Brian, you, and Annie Chen who spearheaded the effort for Help50, 82 00:03:49,170 --> 00:03:51,000 to help make better sense of-- 83 00:03:51,000 --> 00:03:54,070 DAVID MALAN: That was amazing, you said Help50 the moment I said Help50. 84 00:03:54,070 --> 00:03:56,640 DOUG LLOYD: What can I say, I'm pretty good at this stuff. 85 00:03:56,640 --> 00:03:59,280 But it gives us an opportunity to really pick apart 86 00:03:59,280 --> 00:04:01,140 some of those really arcane error messages, 87 00:04:01,140 --> 00:04:04,110 like clang is kind of notorious for being 88 00:04:04,110 --> 00:04:06,174 very difficult to sometimes parse. 89 00:04:06,174 --> 00:04:08,590 DAVID MALAN: Certainly early on when you're new to it all, 90 00:04:08,590 --> 00:04:11,380 especially if you've got one bug that triggers a cascade of other bugs, 91 00:04:11,380 --> 00:04:14,400 and so you're overwhelmed with the number of error messages on the screen. 92 00:04:14,400 --> 00:04:16,350 And you know, I wish we had thought of this earlier, 93 00:04:16,350 --> 00:04:18,558 because at the end of the day Help50 is super simple. 94 00:04:18,558 --> 00:04:21,870 It really is just several dozen regular expressions 95 00:04:21,870 --> 00:04:25,080 that Brian, and Annie, and others wrote, they just look at a student's output 96 00:04:25,080 --> 00:04:26,913 and try to pattern match, looking for things 97 00:04:26,913 --> 00:04:29,040 that might be arcane but at least are deterministic 98 00:04:29,040 --> 00:04:31,290 and you can infer from them what the problem might 99 00:04:31,290 --> 00:04:33,020 be and offer some rhetorical advice. 100 00:04:33,020 --> 00:04:36,090 So it's really meant to be like our virtual TF. 101 00:04:36,090 --> 00:04:37,320 That isn't wrong, too. 102 00:04:37,320 --> 00:04:40,959 I mean we've tried to word all of it's help output in such a way 103 00:04:40,959 --> 00:04:42,750 that we don't tell a student what to do, we 104 00:04:42,750 --> 00:04:45,120 ask them and prompt them with questions to help-- 105 00:04:45,120 --> 00:04:46,980 DOUG LLOYD: The same kind of questions that you would actually propose-- 106 00:04:46,980 --> 00:04:47,280 DAVID MALAN: --them figure out-- 107 00:04:47,280 --> 00:04:49,050 DOUG LLOYD: --in office hours if we saw this happening. 108 00:04:49,050 --> 00:04:49,800 DAVID MALAN: Exactly. 109 00:04:49,800 --> 00:04:50,300 Exactly. 110 00:04:50,300 --> 00:04:53,544 And this has been an interesting tension and I think discussion 111 00:04:53,544 --> 00:04:55,710 that Glen [? Holloway ?] and I've had for some time, 112 00:04:55,710 --> 00:04:58,380 because I've long had a tendency to try to simplify things 113 00:04:58,380 --> 00:05:01,760 in student's environment, the IDE back in the cloud days, the appliance, 114 00:05:01,760 --> 00:05:06,920 but we haven't wanted to have a Clang50 command or Make50 115 00:05:06,920 --> 00:05:10,492 or wrapper scripts that could absolutely exist, but then really put 116 00:05:10,492 --> 00:05:13,700 too much in the way of training wheels on students, because in the real world 117 00:05:13,700 --> 00:05:16,040 they're not going to have Make50 and Clang50 and so forth. 118 00:05:16,040 --> 00:05:17,873 They're going to have make and clang, and we 119 00:05:17,873 --> 00:05:20,240 want them to use those standard tools. 120 00:05:20,240 --> 00:05:23,120 But Help50 is really meant to be temporary training wheels, 121 00:05:23,120 --> 00:05:26,210 a throw away, that after a few weeks of familiarity and usage, 122 00:05:26,210 --> 00:05:29,125 then they can discard that and move on and we've not 123 00:05:29,125 --> 00:05:31,250 sort of done them a lifelong disservice by teaching 124 00:05:31,250 --> 00:05:33,380 them some tool in the wrong way. 125 00:05:33,380 --> 00:05:35,079 It's just a tool dedicated to that. 126 00:05:35,079 --> 00:05:37,370 DOUG LLOYD: It was a lot of fun, and a lot of the staff 127 00:05:37,370 --> 00:05:39,830 got involved in helping to improve this tool. 128 00:05:39,830 --> 00:05:42,830 And I think it was one of the most helpful contributions we 129 00:05:42,830 --> 00:05:46,917 made in the debugging context for students this year. 130 00:05:46,917 --> 00:05:47,750 DAVID MALAN: Indeed. 131 00:05:47,750 --> 00:05:51,020 So I mean we have Debug50 now, Help50 now, eprintf now 132 00:05:51,020 --> 00:05:54,350 as well for more homegrown debugging, but all 133 00:05:54,350 --> 00:05:58,040 of which provide a pretty good tool chain. 134 00:05:58,040 --> 00:06:01,030 You know, a fun fact, these things kind of squeak a little bit, 135 00:06:01,030 --> 00:06:03,860 and I've on multiple occasions been in faculty meetings 136 00:06:03,860 --> 00:06:08,420 this year where I brought a CS50 duck in my jacket pocket 137 00:06:08,420 --> 00:06:11,450 with the intent of giving it to a colleague as a little, 138 00:06:11,450 --> 00:06:14,719 hello from CS50 and invariably in two of these meetings 139 00:06:14,719 --> 00:06:16,760 it's sitting there in my pocket, very discreetly, 140 00:06:16,760 --> 00:06:19,472 no one knows that I've got a rubber duck hidden in my jacket, 141 00:06:19,472 --> 00:06:21,680 and then invariably I'll just move or something and I 142 00:06:21,680 --> 00:06:26,480 move my arm against my side and it's like, who 143 00:06:26,480 --> 00:06:29,380 the hell has a rubber duck in the room.