1 00:00:00,000 --> 00:00:00,060 2 00:00:00,060 --> 00:00:02,700 DAVID MALAN: --to get all the more familiar through practice, 3 00:00:02,700 --> 00:00:04,200 and practice. 4 00:00:04,200 --> 00:00:05,610 All right, so let's actually-- 5 00:00:05,610 --> 00:00:06,720 DOUG LLOYD: You know, one of probably the biggest 6 00:00:06,720 --> 00:00:09,386 questions that we get, and we've answered in a couple of places, 7 00:00:09,386 --> 00:00:10,740 is why do we teach C? 8 00:00:10,740 --> 00:00:12,660 DAVID MALAN: Oh my god, you're going to ask that question, aren't you? 9 00:00:12,660 --> 00:00:14,190 DOUG LLOYD: I'm asking you, why don't we do it? 10 00:00:14,190 --> 00:00:16,530 DAVID MALAN: No, it's a very conscious decision, 11 00:00:16,530 --> 00:00:19,765 and I actually do think it serves us well overall, and hopefully serves 12 00:00:19,765 --> 00:00:22,140 our students very well overall, even though we definitely 13 00:00:22,140 --> 00:00:25,030 pay a price in complexity sometimes, pointers in particular 14 00:00:25,030 --> 00:00:27,900 is a particularly sophisticated subject that a lot of students 15 00:00:27,900 --> 00:00:29,400 understandably wrestle with. 16 00:00:29,400 --> 00:00:32,250 But the reality is, it's such a relatively small language, I 17 00:00:32,250 --> 00:00:35,130 mean we use almost every feature syntactically in logic 18 00:00:35,130 --> 00:00:39,850 and even functionally of it that comes with the standard library at least. 19 00:00:39,850 --> 00:00:45,690 It's pretty low level without going into assembly language, 20 00:00:45,690 --> 00:00:48,057 and there's really no magic or not much magic at all. 21 00:00:48,057 --> 00:00:50,640 You get a little bit of help from the compiler here and there, 22 00:00:50,640 --> 00:00:53,910 but the reality is things are not going to be in memory unless you put them 23 00:00:53,910 --> 00:00:56,409 in memory, and something's not going to be copied unless you 24 00:00:56,409 --> 00:00:57,860 copy every one of those bytes. 25 00:00:57,860 --> 00:01:00,570 And so there is this deliberateness to the language 26 00:01:00,570 --> 00:01:04,035 that I think is really helpful because there really is so little magic. 27 00:01:04,035 --> 00:01:05,910 DOUG LLOYD: Yeah, it gives us the opportunity 28 00:01:05,910 --> 00:01:09,034 to talk about things that you can't even talk about in a lot of more 29 00:01:09,034 --> 00:01:10,200 modern high level languages. 30 00:01:10,200 --> 00:01:13,466 And C has been around for a really long time 31 00:01:13,466 --> 00:01:15,840 it has inspired so many of these other languages, so even 32 00:01:15,840 --> 00:01:18,600 a language like Python that looks really different, it sort still 33 00:01:18,600 --> 00:01:21,770 has the same flow to it, and certainly JavaScript, 34 00:01:21,770 --> 00:01:24,360 or when we used to teach PHP. 35 00:01:24,360 --> 00:01:26,250 They can all sort of count C as ancestors, 36 00:01:26,250 --> 00:01:29,340 and so that's another I think good reason to use it. 37 00:01:29,340 --> 00:01:32,370 DAVID MALAN: Yeah, and I'm so proud of our students 38 00:01:32,370 --> 00:01:34,845 honestly, like mid-semester, by which we have already 39 00:01:34,845 --> 00:01:36,720 looked at what's going on underneath the hood 40 00:01:36,720 --> 00:01:39,837 and they can speak to memory management, and the stack, and the heap, 41 00:01:39,837 --> 00:01:41,670 and they really understand functionally what 42 00:01:41,670 --> 00:01:44,753 is going on underneath the hood, what is the runtime or the computer doing 43 00:01:44,753 --> 00:01:48,057 for you, what is the compiler doing for you, and having that appreciation. 44 00:01:48,057 --> 00:01:50,390 So that when we do get closer to the end of the semester 45 00:01:50,390 --> 00:01:52,348 we introduce Python, and JavaScript, and others 46 00:01:52,348 --> 00:01:54,690 you have a much greater appreciation for, 47 00:01:54,690 --> 00:01:58,067 and understanding of what the language is doing for you and how it's doing it. 48 00:01:58,067 --> 00:02:00,400 DOUG LLOYD: Yeah, you can take those things for granted, 49 00:02:00,400 --> 00:02:04,067 but you still know what you are taking for granted. 50 00:02:04,067 --> 00:02:06,900 DAVID MALAN: Even in Python which has good documentation to the time 51 00:02:06,900 --> 00:02:11,190 complexity or running time of various data 52 00:02:11,190 --> 00:02:13,800 structure algorithms like lists, and sets, and dictionaries, 53 00:02:13,800 --> 00:02:15,922 and so forth, you can actually imagine, all right, 54 00:02:15,922 --> 00:02:18,630 well how must Python be implementing some data structure in order 55 00:02:18,630 --> 00:02:19,920 to achieve this running time. 56 00:02:19,920 --> 00:02:22,211 And we've looked at a very low level by having students 57 00:02:22,211 --> 00:02:24,980 build those structures themselves. 58 00:02:24,980 --> 00:02:28,520 And even the security aspects, it's ridiculous, but to this day 59 00:02:28,520 --> 00:02:33,067 we still suffers a society from buffer overflow attacks and various exploits 60 00:02:33,067 --> 00:02:36,150 based on that, and being able to have a conversation and talk about what's 61 00:02:36,150 --> 00:02:40,770 going on and really demonstrating that this is a pretty low level attack. 62 00:02:40,770 --> 00:02:42,990 But it all makes sense if you just understand 63 00:02:42,990 --> 00:02:46,770 these basics, these first principles on top of which we've 64 00:02:46,770 --> 00:02:48,480 been building these systems. 65 00:02:48,480 --> 00:02:51,560 Like you can infer, even from that alone, how these attacks 66 00:02:51,560 --> 00:02:53,625 are taking advantage of systems. 67 00:02:53,625 --> 00:02:54,125